3535)
3636
3737from nibabies import config
38+ from nibabies .interfaces import DerivativesDataSink
3839from nibabies .workflows .anatomical .brain_extraction import init_infant_brain_extraction_wf
39- from nibabies .workflows .anatomical .outputs import init_anat_reports_wf
40+ from nibabies .workflows .anatomical .outputs import init_anat_reports_wf , init_coreg_report_wf
4041from nibabies .workflows .anatomical .preproc import init_anat_preproc_wf , init_csf_norm_wf
4142from nibabies .workflows .anatomical .registration import (
4243 init_concat_registrations_wf ,
@@ -741,36 +742,33 @@ 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_entities = ('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_entities = ('desc' , 'echo' ),
765+ ** {'from' : 'T2w' },
766+ ),
767+ name = 'ds_t2w2t1w_xfm' ,
768+ run_without_submitting = True ,
769+ )
770+
771+ coreg_report_wf = init_coreg_report_wf (output_dir = output_dir )
774772
775773 workflow .connect ([
776774 (t1w_validate , coregistration_wf , [
@@ -780,22 +778,28 @@ def init_infant_anat_fit_wf(
780778 ('t2w_preproc' , 'inputnode.in_t2w' ),
781779 ('t2w_mask' , 'inputnode.in_mask' ),
782780 ]),
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- # ]),
781+ (coregistration_wf , ds_t1w2t2w_xfm , [
782+ ('outputnode.t1w2t2w_xfm' , 'in_file' ),
783+ ]),
784+ (sourcefile_buffer , ds_t1w2t2w_xfm , [
785+ ('t1w_source_files' , 'source_file' ),
786+ ]),
787+ (coregistration_wf , ds_t2w2t1w_xfm , [
788+ ('outputnode.t2w2t1w_xfm' , 'in_file' ),
789+ ]),
790+ (sourcefile_buffer , ds_t2w2t1w_xfm , [
791+ ('t2w_source_files' , 'source_file' ),
792+ ]),
795793 (coregistration_wf , coreg_buffer , [
796794 ('outputnode.t1w2t2w_xfm' , 't1w2t2w_xfm' ),
797795 ('outputnode.t2w2t1w_xfm' , 't2w2t1w_xfm' ),
798796 ]),
797+ (coregistration_wf , coreg_report_wf , [
798+ ('outputnode.t1w_preproc' , 'inputnode.t1w_preproc' ),
799+ ('outputnode.t2w_preproc' , 'inputnode.t2w_preproc' ),
800+ ('outputnode.t1w_mask' , 'inputnode.in_mask' ),
801+ ]),
802+ (sourcefile_buffer , coreg_report_wf , [('anat_source_files' , 'inputnode.source_file' )]),
799803 ]) # fmt:skip
800804
801805 if probmap :
0 commit comments