Skip to content

Commit

Permalink
Merge pull request #44 from khanlab/xfm-patch
Browse files Browse the repository at this point in the history
added missing final transform as target rule, updated documentation
  • Loading branch information
akhanf authored Mar 22, 2021
2 parents 5f5b76f + b4d2683 commit addde8b
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/getting_started/outputs.rst
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@ ITK transforms to warp images from the ``T1w`` space to the ``unfold`` space are

sub-{subject}
└── seg_T2w
└── sub-{subject}_hemi-{L,R}_from-corobl_to-unfold_mode-image_xfm.nii.gz
└── sub-{subject}_hemi-{L,R}_from-T1w_to-unfold_mode-image_xfm.nii.gz

This is an ITK transform that can transform any image that is in ``T1w`` space (can be any resolution and FOV, as long as aligned to ``T1w``), to the ``unfold`` hippocampal volume space. You can use the warp itself as a reference image, e.g.::

antsApplyTransforms -i sub-001_space-T1w_FA.nii.gz -o sub-001_hemi-L_space-unfold_FA.nii.gz -t sub-001_hemi-L_from-corobl_to-unfold_mode-image_xfm.nii.gz -r sub-001_hemi-L_from-corobl_to-unfold_mode-image_xfm.nii.gz -v
antsApplyTransforms -i sub-001_space-T1w_FA.nii.gz -o sub-001_hemi-L_space-unfold_FA.nii.gz -t sub-001_hemi-L_from-T1w_to-unfold_mode-image_xfm.nii.gz -r sub-001_hemi-L_from-T1w_to-unfold_mode-image_xfm.nii.gz -v


Subfield segmentations
Expand Down
14 changes: 14 additions & 0 deletions hippunfold/workflow/Snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,19 @@ def get_final_coords():

return coords

def get_final_transforms():
transforms = []
for modality in config['modality']:
mod_index = get_modality_key(modality)
transforms = transforms + \
expand(bids(root='results',datatype='seg_{modality}',**config['subj_wildcards'],suffix='xfm.nii.gz',hemi='{hemi}',from_='T1w',to='unfold',mode='image'),
modality=modality,
hemi=['L','R'],
subject=config['input_lists'][mod_index]['subject'],
session=config['sessions'])

return transforms

def get_final_anat():
anat = []
for modality in config['modality']:
Expand Down Expand Up @@ -129,6 +142,7 @@ rule all:
input:
get_final_specs(),
get_final_subfields(),
get_final_transforms(),
get_final_coords(),
get_final_anat(),
get_final_qc(),
Expand Down

0 comments on commit addde8b

Please sign in to comment.