Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Help wanted: SyN registration of anatomical T1 to diffusion b0 image fails after printing 'Negative spacing is not supported and may result in undefined behavior' #296

Open
davidrs06 opened this issue Nov 4, 2022 · 8 comments

Comments

@davidrs06
Copy link

Hi !

I'm trying to register anatomical T1 to diffusion b0 image using sdcflows version 2.1.1, with the Syn option as I don't have any fieldmap nor b0 with opposite phase encoding.

I affine registered the mni_icbm152_t1_tal_nlin_asym_09c.nii template, which I think corresponds to the MNI152NLin2009cAsym template used by sdcflows, to my anatomical T1w scan using AntsPy. The output 'fwdtransforms' is used as std2anat_xfm in sdcflows. I created anatomical and b0 brain masks using FSL bet with the -m option. I took the epi metadata from the original dwi.json file, as the b0 was extracted from the dwi.nii.gz file.

I have the following code, where I create a init_syn_preprocessing_wf() and init_syn_sdc_wf(), linked together via a estimate_sdc workflow:

    from sdcflows.workflows.fit import syn
    from nipype.pipeline import engine as pe
    from nipype.interfaces import io as nio
    import json
    import numpy as np
    
    estimate_sdc = pe.Workflow(name='estimate_sdc')
    
    preproc_wf = syn.init_syn_preprocessing_wf()
    preproc_wf.inputs.inputnode.in_epis = ['b0.nii.gz']
    preproc_wf.inputs.inputnode.t_masks = [True]
    preproc_wf.inputs.inputnode.in_anat = 'T1w.nii.gz'
    preproc_wf.inputs.inputnode.std2anat_xfm = 'T1w_affine2_MNIICBM152T1TalNlinAsym09c.mat'
    preproc_wf.inputs.inputnode.mask_anat = 'T1w_brain_mask.nii.gz'
    in_meta = []
    with open('dwi.json', 'r') as f:
        in_meta.append(json.load(f))
    preproc_wf.inputs.inputnode.in_meta = in_meta
    
    proc_wf = syn.init_syn_sdc_wf()
    proc_wf.inputs.inputnode.epi_mask = 'b0_brain_mask.nii.gz'
    
    estimate_sdc.connect([
        (preproc_wf, proc_wf, [('outputnode.epi_ref', 'inputnode.epi_ref'),
                               ('outputnode.anat_ref', 'inputnode.anat_ref'),
                               ('outputnode.anat_mask', 'inputnode.anat_mask'),
                               ('outputnode.sd_prior', 'inputnode.sd_prior')])
    ])
    
    estimate_sdc.run()

You can have a look at the terminal log below. The log ends after a warning from ITK saying that 'Negative spacing is not supported and may result in undefined behavior', and 'suspicious return value (2) from SVDC'. There's also a stderr printed during the epi2anat node, saying that 'file NULL does not exist '.

Is there an error that strikes you in the code above ? Am I missing something obvious ? Might not be the best way to use sdcflows, any other suggestion would be welcome.

Thanks in advance and best regards !
David

Terminal log can be found here
    221104-16:31:06,277 nipype.workflow INFO:
         Workflow estimate_sdc settings: ['check', 'execution', 'logging', 'monitoring']
    221104-16:31:06,464 nipype.workflow INFO:
         Running serially.
    221104-16:31:06,465 nipype.workflow INFO:
         [Node] Setting-up "estimate_sdc.syn_preprocessing_wf.anat_dilmsk" in "/tmp/tmp2gtq3gcy/estimate_sdc/syn_preprocessing_wf/anat_dilmsk".
    221104-16:31:06,471 nipype.workflow INFO:
         [Node] Executing "anat_dilmsk" <sdcflows.interfaces.brainmask.BinaryDilation>
    221104-16:31:10,737 nipype.workflow INFO:
         [Node] Finished "anat_dilmsk", elapsed time 4.26515s.
    221104-16:31:10,740 nipype.workflow INFO:
         [Node] Setting-up "estimate_sdc.syn_preprocessing_wf.mask_anat" in "/tmp/tmpzb8qox6k/estimate_sdc/syn_preprocessing_wf/mask_anat".
    221104-16:31:10,744 nipype.workflow INFO:
         [Node] Executing "mask_anat" <niworkflows.interfaces.nibabel.ApplyMask>
    221104-16:31:11,942 nipype.workflow INFO:
         [Node] Finished "mask_anat", elapsed time 1.196871s.
    221104-16:31:11,949 nipype.workflow INFO:
         [Node] Setting-up "_validate_nii0" in "/tmp/tmprmhht_ya/estimate_sdc/syn_preprocessing_wf/epi_reference_wf/validate_nii/mapflow/_validate_nii0".
    221104-16:31:11,950 nipype.workflow INFO:
         [Node] Executing "_validate_nii0" <niworkflows.interfaces.header.ValidateImage>
    221104-16:31:12,468 nipype.workflow INFO:
         [Node] Finished "_validate_nii0", elapsed time 0.517855s.
    221104-16:31:12,470 nipype.workflow INFO:
         [Node] Setting-up "estimate_sdc.syn_preprocessing_wf.clip_anat" in "/tmp/tmpmtg6d2s_/estimate_sdc/syn_preprocessing_wf/clip_anat".
    221104-16:31:12,472 nipype.workflow INFO:
         [Node] Executing "clip_anat" <niworkflows.interfaces.nibabel.IntensityClip>
    221104-16:31:21,913 nipype.workflow INFO:
         [Node] Finished "clip_anat", elapsed time 9.440466s.
    221104-16:31:21,918 nipype.workflow INFO:
         [Node] Setting-up "_per_run_avgs0" in "/tmp/tmp9kxnhg0v/estimate_sdc/syn_preprocessing_wf/epi_reference_wf/per_run_avgs/mapflow/_per_run_avgs0".
    221104-16:31:21,919 nipype.workflow INFO:
         [Node] Executing "_per_run_avgs0" <niworkflows.interfaces.images.RobustAverage>
    221104-16:31:21,920 nipype.workflow INFO:
         [Node] Finished "_per_run_avgs0", elapsed time 0.000931s.
    221104-16:31:21,922 nipype.workflow INFO:
         [Node] Setting-up "estimate_sdc.syn_preprocessing_wf.ref_anat" in "/tmp/tmp_s2tubkz/estimate_sdc/syn_preprocessing_wf/ref_anat".
    221104-16:31:21,923 nipype.workflow INFO:
         [Node] Executing "ref_anat" <sdcflows.interfaces.utils.DenoiseImage>
    221104-16:31:53,776 nipype.workflow INFO:
         [Node] Finished "ref_anat", elapsed time 31.852288s.
    221104-16:31:53,781 nipype.workflow INFO:
         [Node] Setting-up "_clip_avgs0" in "/tmp/tmp79_cbz_f/estimate_sdc/syn_preprocessing_wf/epi_reference_wf/clip_avgs/mapflow/_clip_avgs0".
    221104-16:31:53,782 nipype.workflow INFO:
         [Node] Executing "_clip_avgs0" <niworkflows.interfaces.nibabel.IntensityClip>
    221104-16:31:59,750 nipype.workflow INFO:
         [Node] Finished "_clip_avgs0", elapsed time 5.967613s.
    221104-16:31:59,755 nipype.workflow INFO:
         [Node] Setting-up "_n4_avgs0" in "/tmp/tmpfzh_425f/estimate_sdc/syn_preprocessing_wf/epi_reference_wf/n4_avgs/mapflow/_n4_avgs0".
    221104-16:31:59,756 nipype.workflow INFO:
         [Node] Executing "_n4_avgs0" <nipype.interfaces.ants.segmentation.N4BiasFieldCorrection>
    221104-16:33:03,195 nipype.workflow INFO:
         [Node] Finished "_n4_avgs0", elapsed time 63.423969s.
    221104-16:33:03,201 nipype.workflow INFO:
         [Node] Setting-up "_clip_bg_noise0" in "/tmp/tmppb_1i1kr/estimate_sdc/syn_preprocessing_wf/epi_reference_wf/clip_bg_noise/mapflow/_clip_bg_noise0".
    221104-16:33:03,201 nipype.workflow INFO:
         [Node] Executing "_clip_bg_noise0" <niworkflows.interfaces.nibabel.IntensityClip>
    221104-16:33:07,719 nipype.workflow INFO:
         [Node] Finished "_clip_bg_noise0", elapsed time 4.516866s.
    221104-16:33:07,721 nipype.workflow INFO:
         [Node] Setting-up "estimate_sdc.syn_preprocessing_wf.epi_reference_wf.epi_merge" in "/tmp/tmpcg4o5uqy/estimate_sdc/syn_preprocessing_wf/epi_reference_wf/epi_merge".
    221104-16:33:07,723 nipype.workflow INFO:
         [Node] Executing "epi_merge" <niworkflows.interfaces.freesurfer.StructuralReference>
    221104-16:33:07,802 nipype.interface INFO:
         stdout 2022-11-04T16:33:07.802585:Only one time point!
    221104-16:33:07,988 nipype.interface INFO:
         stdout 2022-11-04T16:33:07.988282:7.2.0
    221104-16:33:07,988 nipype.interface INFO:
         stdout 2022-11-04T16:33:07.988282:
    221104-16:33:07,988 nipype.interface INFO:
         stdout 2022-11-04T16:33:07.988789:--inlta: identity.nofile input LTA transform.
    221104-16:33:07,988 nipype.interface INFO:
         stdout 2022-11-04T16:33:07.988789:--outlta: /tmp/tmpcg4o5uqy/estimate_sdc/syn_preprocessing_wf/epi_reference_wf/epi_merge/tp1.lta output LTA.
    221104-16:33:07,988 nipype.interface INFO:
         stdout 2022-11-04T16:33:07.988789:--src: /tmp/tmppb_1i1kr/estimate_sdc/syn_preprocessing_wf/epi_reference_wf/clip_bg_noise/mapflow/_clip_bg_noise0/clipped.nii.gz src image (geometry).
    221104-16:33:07,988 nipype.interface INFO:
         stdout 2022-11-04T16:33:07.988789:--trg: /tmp/tmppb_1i1kr/estimate_sdc/syn_preprocessing_wf/epi_reference_wf/clip_bg_noise/mapflow/_clip_bg_noise0/clipped.nii.gz trg image (geometry).
    221104-16:33:07,989 nipype.interface INFO:
         stdout 2022-11-04T16:33:07.988996:niiRead(): NIFTI_UNITS_UNKNOWN, assuming mm
    221104-16:33:07,989 nipype.interface INFO:
         stdout 2022-11-04T16:33:07.988996:niiRead(): NIFTI_UNITS_UNKNOWN, assuming mm
    221104-16:33:07,989 nipype.interface INFO:
         stdout 2022-11-04T16:33:07.988996: LTA read, type : 1
    221104-16:33:07,989 nipype.interface INFO:
         stdout 2022-11-04T16:33:07.988996: 1.00000   0.00000   0.00000   0.00000;
    221104-16:33:07,989 nipype.interface INFO:
         stdout 2022-11-04T16:33:07.988996: 0.00000   1.00000   0.00000   0.00000;
    221104-16:33:07,989 nipype.interface INFO:
         stdout 2022-11-04T16:33:07.988996: 0.00000   0.00000   1.00000   0.00000;
    221104-16:33:07,989 nipype.interface INFO:
         stdout 2022-11-04T16:33:07.988996: 0.00000   0.00000   0.00000   1.00000;
    221104-16:33:07,989 nipype.interface INFO:
         stdout 2022-11-04T16:33:07.989263:Writing  LTA to file /tmp/tmpcg4o5uqy/estimate_sdc/syn_preprocessing_wf/epi_reference_wf/epi_merge/tp1.lta...
    221104-16:33:07,989 nipype.interface INFO:
         stdout 2022-11-04T16:33:07.989263:lta_convert successful.
    221104-16:33:08,99 nipype.workflow INFO:
         [Node] Finished "epi_merge", elapsed time 0.376191s.
    221104-16:33:08,101 nipype.workflow INFO:
         [Node] Setting-up "estimate_sdc.syn_preprocessing_wf.epi_reference_wf.post_merge" in "/tmp/tmp8sq2u3v_/estimate_sdc/syn_preprocessing_wf/epi_reference_wf/post_merge".
    221104-16:33:08,102 nipype.workflow INFO:
         [Node] Executing "post_merge" <nipype.interfaces.utility.wrappers.Function>
    221104-16:33:08,103 nipype.workflow INFO:
         [Node] Finished "post_merge", elapsed time 0.00047s.
    221104-16:33:08,104 nipype.workflow INFO:
         [Node] Setting-up "estimate_sdc.syn_preprocessing_wf.deob_epi" in "/tmp/tmpi5mn3f23/estimate_sdc/syn_preprocessing_wf/deob_epi".
    221104-16:33:08,106 nipype.workflow INFO:
         [Node] Executing "deob_epi" <sdcflows.interfaces.utils.Deoblique>
    221104-16:33:08,220 nipype.workflow INFO:
         [Node] Finished "deob_epi", elapsed time 0.114057s.
    221104-16:33:08,221 nipype.workflow INFO:
         [Node] Setting-up "estimate_sdc.syn_preprocessing_wf.merge_output" in "/tmp/tmplr98qarm/estimate_sdc/syn_preprocessing_wf/merge_output".
    221104-16:33:08,224 nipype.workflow INFO:
         [Node] Executing "merge_output" <nipype.interfaces.utility.wrappers.Function>
    221104-16:33:08,225 nipype.workflow INFO:
         [Node] Finished "merge_output", elapsed time 0.000324s.
    221104-16:33:08,227 nipype.workflow INFO:
         [Node] Setting-up "estimate_sdc.syn_preprocessing_wf.epi_brain" in "/tmp/tmp9f5m0ti1/estimate_sdc/syn_preprocessing_wf/epi_brain".
    221104-16:33:08,228 nipype.workflow INFO:
         [Node] Executing "epi_brain" <sdcflows.interfaces.brainmask.BrainExtraction>
    221104-16:33:49,96 nipype.workflow INFO:
         [Node] Finished "epi_brain", elapsed time 40.867074s.
    221104-16:33:49,100 nipype.workflow INFO:
         [Node] Setting-up "estimate_sdc.syn_preprocessing_wf.sampling_ref" in "/tmp/tmp74z_9omh/estimate_sdc/syn_preprocessing_wf/sampling_ref".
    221104-16:33:49,118 nipype.workflow INFO:
         [Node] Executing "sampling_ref" <niworkflows.interfaces.nibabel.GenerateSamplingReference>
    221104-16:33:49,854 nipype.workflow INFO:
         [Node] Finished "sampling_ref", elapsed time 0.73461s.
    221104-16:33:49,855 nipype.workflow INFO:
         [Node] Setting-up "estimate_sdc.syn_sdc_wf.readout_time" in "/tmp/tmpy5h9luwy/estimate_sdc/syn_sdc_wf/readout_time".
    221104-16:33:49,859 nipype.workflow INFO:
         [Node] Executing "readout_time" <sdcflows.interfaces.epi.GetReadoutTime>
    221104-16:33:49,863 nipype.workflow INFO:
         [Node] Finished "readout_time", elapsed time 0.003504s.
    221104-16:33:49,864 nipype.workflow INFO:
         [Node] Setting-up "estimate_sdc.syn_sdc_wf.clip_epi" in "/tmp/tmpb8cbpj8p/estimate_sdc/syn_sdc_wf/clip_epi".
    221104-16:33:49,866 nipype.workflow INFO:
         [Node] Executing "clip_epi" <niworkflows.interfaces.nibabel.IntensityClip>
    221104-16:33:53,602 nipype.workflow INFO:
         [Node] Finished "clip_epi", elapsed time 3.73563s.
    221104-16:33:53,603 nipype.workflow INFO:
         [Node] Setting-up "estimate_sdc.syn_preprocessing_wf.epi_dilmsk" in "/tmp/tmptiax6svq/estimate_sdc/syn_preprocessing_wf/epi_dilmsk".
    221104-16:33:53,605 nipype.workflow INFO:
         [Node] Executing "epi_dilmsk" <sdcflows.interfaces.brainmask.BinaryDilation>
    221104-16:33:54,94 nipype.workflow INFO:
         [Node] Finished "epi_dilmsk", elapsed time 0.488626s.
    221104-16:33:54,95 nipype.workflow INFO:
         [Node] Setting-up "estimate_sdc.syn_sdc_wf.lap_epi" in "/tmp/tmpciy8gryd/estimate_sdc/syn_sdc_wf/lap_epi".
    221104-16:33:54,97 nipype.workflow INFO:
         [Node] Executing "lap_epi" <nipype.interfaces.ants.utils.ImageMath>
    221104-16:33:55,942 nipype.workflow INFO:
         [Node] Finished "lap_epi", elapsed time 1.8451650000000002s.
    221104-16:33:55,944 nipype.workflow INFO:
         [Node] Setting-up "estimate_sdc.syn_preprocessing_wf.epi2anat" in "/tmp/tmpcm8w4pgr/estimate_sdc/syn_preprocessing_wf/epi2anat".
    221104-16:33:55,948 nipype.workflow INFO:
         [Node] Executing "epi2anat" <niworkflows.interfaces.fixes.FixHeaderRegistration>
    221104-16:33:56,568 nipype.interface INFO:
         stderr 2022-11-04T16:33:56.567787: file NULL does not exist . 
    221104-16:38:46,175 nipype.workflow INFO:
         [Node] Finished "epi2anat", elapsed time 290.207465s.
    221104-16:38:46,178 nipype.workflow INFO:
         [Node] Setting-up "estimate_sdc.syn_sdc_wf.lap_epi_norm" in "/tmp/tmpbvqkczp0/estimate_sdc/syn_sdc_wf/lap_epi_norm".
    221104-16:38:46,180 nipype.workflow INFO:
         [Node] Executing "lap_epi_norm" <nipype.interfaces.utility.wrappers.Function>
    221104-16:38:46,973 nipype.workflow INFO:
         [Node] Finished "lap_epi_norm", elapsed time 0.792257s.
    221104-16:38:46,974 nipype.workflow INFO:
         [Node] Setting-up "estimate_sdc.syn_preprocessing_wf.transform_list" in "/tmp/tmp13ql335t/estimate_sdc/syn_preprocessing_wf/transform_list".
    221104-16:38:46,998 nipype.workflow INFO:
         [Node] Executing "transform_list" <nipype.interfaces.utility.base.Merge>
    221104-16:38:47,0 nipype.workflow INFO:
         [Node] Finished "transform_list", elapsed time 0.000319s.
    221104-16:38:47,2 nipype.workflow INFO:
         [Node] Setting-up "estimate_sdc.syn_preprocessing_wf.anat2epi" in "/tmp/tmp8gkifos0/estimate_sdc/syn_preprocessing_wf/anat2epi".
    221104-16:38:47,6 nipype.workflow INFO:
         [Node] Executing "anat2epi" <niworkflows.interfaces.fixes.FixHeaderApplyTransforms>
    221104-16:38:49,550 nipype.workflow INFO:
         [Node] Finished "anat2epi", elapsed time 2.54306s.
    221104-16:38:49,551 nipype.workflow INFO:
         [Node] Setting-up "estimate_sdc.syn_preprocessing_wf.mask2epi" in "/tmp/tmp9rbcoux4/estimate_sdc/syn_preprocessing_wf/mask2epi".
    221104-16:38:49,557 nipype.workflow INFO:
         [Node] Executing "mask2epi" <niworkflows.interfaces.fixes.FixHeaderApplyTransforms>
    221104-16:39:38,856 nipype.workflow INFO:
         [Node] Finished "mask2epi", elapsed time 49.298067s.
    221104-16:39:38,857 nipype.workflow INFO:
         [Node] Setting-up "estimate_sdc.syn_sdc_wf.epi_merge" in "/tmp/tmpn7dh9e_1/estimate_sdc/syn_sdc_wf/epi_merge".
    221104-16:39:38,859 nipype.workflow INFO:
         [Node] Executing "epi_merge" <nipype.interfaces.utility.base.Merge>
    221104-16:39:38,860 nipype.workflow INFO:
         [Node] Finished "epi_merge", elapsed time 0.000175s.
    221104-16:39:38,861 nipype.workflow INFO:
         [Node] Setting-up "estimate_sdc.syn_preprocessing_wf.prior2epi" in "/tmp/tmp6dpfwj00/estimate_sdc/syn_preprocessing_wf/prior2epi".
    221104-16:39:38,868 nipype.workflow INFO:
         [Node] Executing "prior2epi" <niworkflows.interfaces.fixes.FixHeaderApplyTransforms>
    221104-16:39:41,342 nipype.workflow INFO:
         [Node] Finished "prior2epi", elapsed time 2.473643s.
    221104-16:39:41,344 nipype.workflow INFO:
         [Node] Setting-up "estimate_sdc.syn_sdc_wf.warp_dir" in "/tmp/tmp77dqa626/estimate_sdc/syn_sdc_wf/warp_dir".
    221104-16:39:41,347 nipype.workflow INFO:
         [Node] Executing "warp_dir" <nipype.interfaces.utility.wrappers.Function>
    221104-16:39:41,349 nipype.workflow INFO:
         [Node] Finished "warp_dir", elapsed time 0.001819s.
    221104-16:39:41,350 nipype.workflow INFO:
         [Node] Setting-up "estimate_sdc.syn_sdc_wf.lap_anat" in "/tmp/tmpzerkn4vb/estimate_sdc/syn_sdc_wf/lap_anat".
    221104-16:39:41,352 nipype.workflow INFO:
         [Node] Executing "lap_anat" <nipype.interfaces.ants.utils.ImageMath>
    221104-16:39:44,901 nipype.workflow INFO:
         [Node] Finished "lap_anat", elapsed time 3.548093s.
    221104-16:39:44,902 nipype.workflow INFO:
         [Node] Setting-up "estimate_sdc.syn_sdc_wf.find_zooms" in "/tmp/tmp2zy3npsb/estimate_sdc/syn_sdc_wf/find_zooms".
    221104-16:39:44,905 nipype.workflow INFO:
         [Node] Executing "find_zooms" <nipype.interfaces.utility.wrappers.Function>
    221104-16:39:44,907 nipype.workflow INFO:
         [Node] Finished "find_zooms", elapsed time 0.001686s.
    221104-16:39:44,908 nipype.workflow INFO:
         [Node] Setting-up "estimate_sdc.syn_preprocessing_wf.mask_dtype" in "/tmp/tmptt0p7fc_/estimate_sdc/syn_preprocessing_wf/mask_dtype".
    221104-16:39:44,909 nipype.workflow INFO:
         [Node] Executing "mask_dtype" <nipype.interfaces.utility.wrappers.Function>
    221104-16:39:45,135 nipype.workflow INFO:
         [Node] Finished "mask_dtype", elapsed time 0.225347s.
    221104-16:39:45,137 nipype.workflow INFO:
         [Node] Setting-up "estimate_sdc.syn_sdc_wf.atlas_msk" in "/tmp/tmpjtqzjzcv/estimate_sdc/syn_sdc_wf/atlas_msk".
    221104-16:39:45,138 nipype.workflow INFO:
         [Node] Executing "atlas_msk" <niworkflows.interfaces.nibabel.Binarize>
    221104-16:39:45,780 nipype.workflow INFO:
         [Node] Finished "atlas_msk", elapsed time 0.641053s.
    221104-16:39:45,781 nipype.workflow INFO:
         [Node] Setting-up "estimate_sdc.syn_sdc_wf.lap_anat_norm" in "/tmp/tmp6fz3m57h/estimate_sdc/syn_sdc_wf/lap_anat_norm".
    221104-16:39:45,783 nipype.workflow INFO:
         [Node] Executing "lap_anat_norm" <nipype.interfaces.utility.wrappers.Function>
    221104-16:39:47,411 nipype.workflow INFO:
         [Node] Finished "lap_anat_norm", elapsed time 1.5660370000000001s.
    221104-16:39:47,415 nipype.workflow INFO:
         [Node] Setting-up "estimate_sdc.syn_sdc_wf.zooms_epi" in "/tmp/tmpg_djzzwd/estimate_sdc/syn_sdc_wf/zooms_epi".
    221104-16:39:47,420 nipype.workflow INFO:
         [Node] Executing "zooms_epi" <niworkflows.interfaces.nibabel.RegridToZooms>
    221104-16:39:48,395 nipype.workflow INFO:
         [Node] Finished "zooms_epi", elapsed time 0.974197s.
    221104-16:39:48,396 nipype.workflow INFO:
         [Node] Setting-up "estimate_sdc.syn_sdc_wf.anat_dilmsk" in "/tmp/tmpldx9lwtk/estimate_sdc/syn_sdc_wf/anat_dilmsk".
    221104-16:39:48,397 nipype.workflow INFO:
         [Node] Executing "anat_dilmsk" <sdcflows.interfaces.brainmask.BinaryDilation>
    221104-16:39:49,350 nipype.workflow INFO:
         [Node] Finished "anat_dilmsk", elapsed time 0.95203s.
    221104-16:39:49,351 nipype.workflow INFO:
         [Node] Setting-up "estimate_sdc.syn_sdc_wf.fixed_masks" in "/tmp/tmpm1nowryn/estimate_sdc/syn_sdc_wf/fixed_masks".
    221104-16:39:49,353 nipype.workflow INFO:
         [Node] Executing "fixed_masks" <nipype.interfaces.utility.base.Merge>
    221104-16:39:49,353 nipype.workflow INFO:
         [Node] Finished "fixed_masks", elapsed time 0.000146s.
    221104-16:39:49,354 nipype.workflow INFO:
         [Node] Setting-up "estimate_sdc.syn_sdc_wf.anat_merge" in "/tmp/tmp8krewtfb/estimate_sdc/syn_sdc_wf/anat_merge".
    221104-16:39:49,356 nipype.workflow INFO:
         [Node] Executing "anat_merge" <nipype.interfaces.utility.base.Merge>
    221104-16:39:49,356 nipype.workflow INFO:
         [Node] Finished "anat_merge", elapsed time 0.000117s.
    221104-16:39:49,357 nipype.workflow INFO:
         [Node] Setting-up "estimate_sdc.syn_sdc_wf.amask2epi" in "/tmp/tmpcr3an2uy/estimate_sdc/syn_sdc_wf/amask2epi".
    221104-16:39:49,369 nipype.workflow INFO:
         [Node] Executing "amask2epi" <niworkflows.interfaces.fixes.FixHeaderApplyTransforms>
    221104-16:39:50,42 nipype.workflow INFO:
         [Node] Finished "amask2epi", elapsed time 0.672504s.
    221104-16:39:50,44 nipype.workflow INFO:
         [Node] Setting-up "estimate_sdc.syn_sdc_wf.epi_umask" in "/tmp/tmppuax9uze/estimate_sdc/syn_sdc_wf/epi_umask".
    221104-16:39:50,45 nipype.workflow INFO:
         [Node] Executing "epi_umask" <sdcflows.interfaces.brainmask.Union>
    221104-16:39:50,165 nipype.workflow INFO:
         [Node] Finished "epi_umask", elapsed time 0.119573s.
    221104-16:39:50,166 nipype.workflow INFO:
         [Node] Setting-up "estimate_sdc.syn_sdc_wf.moving_masks" in "/tmp/tmptbzj34ne/estimate_sdc/syn_sdc_wf/moving_masks".
    221104-16:39:50,168 nipype.workflow INFO:
         [Node] Executing "moving_masks" <nipype.interfaces.utility.base.Merge>
    221104-16:39:50,168 nipype.workflow INFO:
         [Node] Finished "moving_masks", elapsed time 0.000145s.
    221104-16:39:50,169 nipype.workflow INFO:
         [Node] Setting-up "estimate_sdc.syn_sdc_wf.syn" in "/tmp/tmp2qst_tc_/estimate_sdc/syn_sdc_wf/syn".
    221104-16:39:50,175 nipype.workflow INFO:
         [Node] Executing "syn" <niworkflows.interfaces.fixes.FixHeaderRegistration>
    221104-16:40:01,959 nipype.interface INFO:
         stderr 2022-11-04T16:40:01.959393:WARNING: In /Software/build/staging/include/ITK-5.3/itkImageBase.hxx, line 87
    221104-16:40:01,959 nipype.interface INFO:
         stderr 2022-11-04T16:40:01.959393:Image (0x55c1451df050): Negative spacing is not supported and may result in undefined behavior.
    221104-16:40:01,959 nipype.interface INFO:
         stderr 2022-11-04T16:40:01.959393:Proceeding to set spacing to [0.0224859, -inf]
    221104-16:40:01,959 nipype.interface INFO:
         stderr 2022-11-04T16:40:01.959393:
    221104-16:40:01,959 nipype.interface INFO:
         stderr 2022-11-04T16:40:01.959861:/Software/build/ITKv5/Modules/ThirdParty/VNL/src/vxl/core/vnl/algo/vnl_svd.hxx: suspicious return value (2) from SVDC
    221104-16:40:01,959 nipype.interface INFO:
         stderr 2022-11-04T16:40:01.959861:/Software/build/ITKv5/Modules/ThirdParty/VNL/src/vxl/core/vnl/algo/vnl_svd.hxx: M is 2x2
    221104-16:40:01,959 nipype.interface INFO:
         stderr 2022-11-04T16:40:01.959861:M = [ ...
    221104-16:40:01,959 nipype.interface INFO:
         stderr 2022-11-04T16:40:01.959861: 0.0224858986806             -nan 
    221104-16:40:01,959 nipype.interface INFO:
         stderr 2022-11-04T16:40:01.959861:               0             -inf  ]
    221104-16:40:03,388 nipype.workflow INFO:
         [Node] Finished "syn", elapsed time 13.199512s.
    221104-16:40:03,389 nipype.workflow WARNING:
         Storing result file without outputs
    221104-16:40:03,389 nipype.workflow WARNING:
         [Node] Error on "estimate_sdc.syn_sdc_wf.syn" (/tmp/tmp2qst_tc_/estimate_sdc/syn_sdc_wf/syn)
    221104-16:40:03,396 nipype.workflow ERROR:
         Node syn failed to run on host stiitsrv21.
    221104-16:40:03,399 nipype.workflow ERROR:
         Saving crash info to /crash-20221104-164003-syn-17a3248d-5976-4aaa-a147-7326ebfab6a9.pklz
    Traceback (most recent call last):
      File "/Software/anaconda3/envs/spam/lib/python3.8/site-packages/nipype/pipeline/plugins/linear.py", line 47, in run
        node.run(updatehash=updatehash)
      File "Software/anaconda3/envs/spam/lib/python3.8/site-packages/nipype/pipeline/engine/nodes.py", line 527, in run
        result = self._run_interface(execute=True)
      File "/Software/anaconda3/envs/spam/lib/python3.8/site-packages/nipype/pipeline/engine/nodes.py", line 645, in _run_interface
        return self._run_command(execute)
      File "/Software/anaconda3/envs/spam/lib/python3.8/site-packages/nipype/pipeline/engine/nodes.py", line 771, in _run_command
        raise NodeExecutionError(msg)
    nipype.pipeline.engine.nodes.NodeExecutionError: Exception raised while executing Node syn.
@effigies
Copy link
Member

effigies commented Nov 4, 2022

What are the orientations of your input images, including the template? We very likely assume that everything but the EPI image is in RAS orientation. the "Negative spacing is not supported" suggests to me that you probably have an LAS image somewhere.

@davidrs06
Copy link
Author

davidrs06 commented Nov 7, 2022

Hi @effigies ! Thanks for your comment, this is likely the issue. MRTrix mrinfo commands outputs the stride -1 3 -2 for my anatomical scan, while RAS stride should be 1 2 3. I took the anatomical image from FreeSurfer's images, as I have several repeats, and found out that Freesurfer did a good job at aligning and merging them. This seems to be Freesurfer orientation. I'll have a try after converting it to RAS in a couple of days. The EPI has stride -1 2 3, which I think means it is has LAS orientation. Is this ok, or should the EPI also be converted to RAS ? The template is in RAS (stride is 1 2 3).

Thanks again and best regards,
David

@effigies
Copy link
Member

effigies commented Nov 7, 2022

Because BOLD EPIs are often very long, we prefer not to reorient them unless we must, so we have been intentionally more lenient there. I would expect it to be fine to have your EPI in LAS or RAS, but please let us know if that's incorrect.

@davidrs06
Copy link
Author

Hi again ! Changing just the anatomical scan to RAS didn't solve the issue, but converting both the EPI and anatomical images allowed the workflow to run without errors. Haven't checked the output yet, but at least the error is gone, thanks for your comment !

@arokem
Copy link

arokem commented Nov 9, 2022

Commenting from the peanut gallery, I will just mention that we have had much more luck registering the dMRI anisotropic power map to T1-weighted templates. There's an implementation of APM in DIPY.

@davidrs06
Copy link
Author

davidrs06 commented Nov 10, 2022

Thanks for the comment and the reference. Is the full abstract available somewhere ? I can only see a low-resolution, cropped snapshot of Figure 1, which seems to mention registration of T1 to AP.

@arokem
Copy link

arokem commented Nov 10, 2022

@arokem
Copy link

arokem commented Nov 10, 2022

This is another relevant reference: https://www.biorxiv.org/content/10.1101/864108v2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants