Skip to content

Commit 93cc325

Browse files
committed
ENH: Output T1<->T2 coregistration
1 parent b18d491 commit 93cc325

File tree

1 file changed

+38
-42
lines changed
  • nibabies/workflows/anatomical

1 file changed

+38
-42
lines changed

nibabies/workflows/anatomical/fit.py

Lines changed: 38 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
)
3636

3737
from nibabies import config
38+
from nibabies.interfaces import DerivativesDataSink
3839
from nibabies.workflows.anatomical.brain_extraction import init_infant_brain_extraction_wf
3940
from nibabies.workflows.anatomical.outputs import init_anat_reports_wf
4041
from nibabies.workflows.anatomical.preproc import init_anat_preproc_wf, init_csf_norm_wf
@@ -741,36 +742,31 @@ def init_infant_anat_fit_wf(
741742
probmap=probmap,
742743
)
743744

744-
# TODO: Currently the XFMs are transform0GenericAffine.mat, transform1Warp.nii.gz
745-
# The coregistration should be changed to instead save
746-
# 'composite_transform' and 'inverse_composite_transform'
747-
# from antsRegistration (single h5 files)
748-
#
749-
# ds_t1w2t2w_xfm = pe.Node(
750-
# DerivativesDataSink(
751-
# base_directory=output_dir,
752-
# to='T2w',
753-
# mode='image',
754-
# suffix='xfm',
755-
# dismiss_entites=('desc', 'echo'),
756-
# **{'from': 'T1w'}
757-
# ),
758-
# name='ds_t1w2t2w_xfm',
759-
# run_without_submitting=True,
760-
# )
761-
762-
# ds_t2w2t1w_xfm = pe.Node(
763-
# DerivativesDataSink(
764-
# base_directory=output_dir,
765-
# to='T1w',
766-
# mode='image',
767-
# suffix='xfm',
768-
# dismiss_entites=('desc', 'echo'),
769-
# **{'from': 'T2w'}
770-
# ),
771-
# name='ds_t2w2t1w_xfm',
772-
# run_without_submitting=True,
773-
# )
745+
ds_t1w2t2w_xfm = pe.Node(
746+
DerivativesDataSink(
747+
base_directory=output_dir,
748+
to='T2w',
749+
mode='image',
750+
suffix='xfm',
751+
dismiss_entites=('desc', 'echo'),
752+
**{'from': 'T1w'},
753+
),
754+
name='ds_t1w2t2w_xfm',
755+
run_without_submitting=True,
756+
)
757+
758+
ds_t2w2t1w_xfm = pe.Node(
759+
DerivativesDataSink(
760+
base_directory=output_dir,
761+
to='T1w',
762+
mode='image',
763+
suffix='xfm',
764+
dismiss_entites=('desc', 'echo'),
765+
**{'from': 'T2w'},
766+
),
767+
name='ds_t2w2t1w_xfm',
768+
run_without_submitting=True,
769+
)
774770

775771
workflow.connect([
776772
(t1w_validate, coregistration_wf, [
@@ -780,18 +776,18 @@ def init_infant_anat_fit_wf(
780776
('t2w_preproc', 'inputnode.in_t2w'),
781777
('t2w_mask', 'inputnode.in_mask'),
782778
]),
783-
# (coregistration_wf, ds_t1w2t2w_xfm, [
784-
# ('outputnode.t1w2t2w_xfm', 'in_file'),
785-
# ]),
786-
# (sourcefile_buffer, ds_t1w2t2w_xfm, [
787-
# ('t1w_source_files', 'source_file'),
788-
# ]),
789-
# (coregistration_wf, ds_t2w2t1w_xfm, [
790-
# ('outputnode.t2w2t1w_xfm', 'in_file'),
791-
# ]),
792-
# (sourcefile_buffer, ds_t2w2t1w_xfm, [
793-
# ('t2w_source_files', 'source_file'),
794-
# ]),
779+
(coregistration_wf, ds_t1w2t2w_xfm, [
780+
('outputnode.t1w2t2w_xfm', 'in_file'),
781+
]),
782+
(sourcefile_buffer, ds_t1w2t2w_xfm, [
783+
('t1w_source_files', 'source_file'),
784+
]),
785+
(coregistration_wf, ds_t2w2t1w_xfm, [
786+
('outputnode.t2w2t1w_xfm', 'in_file'),
787+
]),
788+
(sourcefile_buffer, ds_t2w2t1w_xfm, [
789+
('t2w_source_files', 'source_file'),
790+
]),
795791
(coregistration_wf, coreg_buffer, [
796792
('outputnode.t1w2t2w_xfm', 't1w2t2w_xfm'),
797793
('outputnode.t2w2t1w_xfm', 't2w2t1w_xfm'),

0 commit comments

Comments
 (0)