From b6844c1a6f113393e7c63f76ff6836bc0a0a4f3d Mon Sep 17 00:00:00 2001 From: jordandekraker Date: Thu, 17 Nov 2022 10:49:54 -0500 Subject: [PATCH 1/3] defined in mm instead of vox this should be more robust to different input image resolutions. 52mm iso should be enough to cover the whole hippocampus. --- hippunfold/config/snakebids.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hippunfold/config/snakebids.yml b/hippunfold/config/snakebids.yml index a9286f86..6cbc4043 100644 --- a/hippunfold/config/snakebids.yml +++ b/hippunfold/config/snakebids.yml @@ -192,7 +192,7 @@ parse_args: --crop_native_box: help: 'Sets the bounding box size for the crop native (e.g. cropT1w) space). Make this larger if your hippocampi in crop{T1w,T2w} space are getting cut-off (default: %(default)s)' - default: '256x256x256vox' + default: '52x52x52mm' --atlas: choices: @@ -386,7 +386,7 @@ nnunet_model: hippb500: trained_model.3d_fullres.Task110_hcp1200_b1000crop.nnUNetTrainerV2.model_best.tar neonateT1w: trained_model.3d_fullres.Task205_hcp1200_b1000_finetuneround2_dhcp_T1w.nnUNetTrainerV2.model_best.tar -crop_native_box: '256x256x256vox' +crop_native_box: '52x52x52mm' hippdwi_opts: resample_dim: '734x720x67' # from 220x216x20 @ 1x1x1mm -> 0.3mm From 751628462cbaecdd9ff7b2a5de5190f950ad54b0 Mon Sep 17 00:00:00 2001 From: jordandekraker Date: Thu, 17 Nov 2022 15:25:05 -0500 Subject: [PATCH 2/3] option to specify cropT1w resolution --- hippunfold/config/snakebids.yml | 9 ++++++++- .../workflow/rules/resample_final_to_crop_native.smk | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/hippunfold/config/snakebids.yml b/hippunfold/config/snakebids.yml index 6cbc4043..29c12c79 100644 --- a/hippunfold/config/snakebids.yml +++ b/hippunfold/config/snakebids.yml @@ -190,10 +190,16 @@ parse_args: default: false action: store_true + --crop_native_res: + help: 'Sets the bounding box resolution for the crop native (e.g. cropT1w space). Under the hood, hippUnfold operates at higher resolution than the native image, so this tries to preserve some of that detail. (default: %(default)s)' + default: '0.2x0.2x0.2mm' + --crop_native_box: - help: 'Sets the bounding box size for the crop native (e.g. cropT1w) space). Make this larger if your hippocampi in crop{T1w,T2w} space are getting cut-off (default: %(default)s)' + help: 'Sets the bounding box size for the crop native (e.g. cropT1w space). Make this larger if your hippocampi in crop{T1w,T2w} space are getting cut-off (default: %(default)s)' default: '52x52x52mm' + + --atlas: choices: - 'bigbrain' @@ -387,6 +393,7 @@ nnunet_model: neonateT1w: trained_model.3d_fullres.Task205_hcp1200_b1000_finetuneround2_dhcp_T1w.nnUNetTrainerV2.model_best.tar crop_native_box: '52x52x52mm' +crop_native_res: '0.2x0.2x0.2mm' hippdwi_opts: resample_dim: '734x720x67' # from 220x216x20 @ 1x1x1mm -> 0.3mm diff --git a/hippunfold/workflow/rules/resample_final_to_crop_native.smk b/hippunfold/workflow/rules/resample_final_to_crop_native.smk index b8c9fbb6..cc369411 100644 --- a/hippunfold/workflow/rules/resample_final_to_crop_native.smk +++ b/hippunfold/workflow/rules/resample_final_to_crop_native.smk @@ -17,7 +17,7 @@ rule create_native_crop_ref: allow_missing=True, ), params: - resample="400%", + resample=["crop_native_res"], pad_to=config["crop_native_box"], output: ref=bids( From cab5c3e802a8655de88335554605685d09e8e6d9 Mon Sep 17 00:00:00 2001 From: jordandekraker Date: Thu, 17 Nov 2022 15:27:37 -0500 Subject: [PATCH 3/3] typo --- hippunfold/workflow/rules/resample_final_to_crop_native.smk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hippunfold/workflow/rules/resample_final_to_crop_native.smk b/hippunfold/workflow/rules/resample_final_to_crop_native.smk index cc369411..e583be93 100644 --- a/hippunfold/workflow/rules/resample_final_to_crop_native.smk +++ b/hippunfold/workflow/rules/resample_final_to_crop_native.smk @@ -17,7 +17,7 @@ rule create_native_crop_ref: allow_missing=True, ), params: - resample=["crop_native_res"], + resample=config["crop_native_res"], pad_to=config["crop_native_box"], output: ref=bids(