diff --git a/pyproject.toml b/pyproject.toml index 25c00e7c..60701f8d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -166,6 +166,7 @@ ignore = [ "S602", # TODO: Fix these "E402", # TODO: Fix these "UP028", # TODO: Fix these + "UP031", # TODO: Fix these "BLE001", # TODO: Fix these ] diff --git a/qsiprep/config.py b/qsiprep/config.py index 9e92f522..aa3b0ba9 100644 --- a/qsiprep/config.py +++ b/qsiprep/config.py @@ -151,7 +151,7 @@ # Just get so analytics track one hit from contextlib import suppress - from requests import ConnectionError, ReadTimeout + from requests import ConnectionError, ReadTimeout # noqa: A004 from requests import get as _get_url with suppress((ConnectionError, ReadTimeout)): diff --git a/qsiprep/interfaces/__init__.py b/qsiprep/interfaces/__init__.py index 4d3664c5..41c48c60 100644 --- a/qsiprep/interfaces/__init__.py +++ b/qsiprep/interfaces/__init__.py @@ -3,16 +3,9 @@ from .bids import BIDSDataGrabber, BIDSInfo, DerivativesDataSink, DerivativesMaybeDataSink from .confounds import DMRISummary, GatherConfounds from .fmap import FieldToHz, FieldToRadS, Phasediff2Fieldmap, Phases2Fieldmap -from .freesurfer import ( - FSDetectInputs, - FSInjectBrainExtracted, - MakeMidthickness, - RefineBrainMask, - StructuralReference, -) +from .freesurfer import StructuralReference from .images import Conform, ConformDwi, IntraModalMerge, ValidateImage from .reports import AboutSummary, SubjectSummary -from .surf import NormalizeSurf from .utils import AddTSVHeader, ConcatAffines __all__ = [ @@ -23,14 +16,10 @@ 'DMRISummary', 'FieldToHz', 'FieldToRadS', - 'FSDetectInputs', - 'FSInjectBrainExtracted', 'GatherConfounds', 'IntraModalMerge', - 'MakeMidthickness', 'Phasediff2Fieldmap', 'Phases2Fieldmap', - 'RefineBrainMask', 'StructuralReference', 'ValidateImage', 'AboutSummary', @@ -39,5 +28,4 @@ 'ConcatAffines', 'DerivativesDataSink', 'DerivativesMaybeDataSink', - 'NormalizeSurf', ] diff --git a/qsiprep/interfaces/freesurfer.py b/qsiprep/interfaces/freesurfer.py index a277e037..ce3f7e00 100644 --- a/qsiprep/interfaces/freesurfer.py +++ b/qsiprep/interfaces/freesurfer.py @@ -19,30 +19,22 @@ """ import os.path as op -from pathlib import Path import nibabel as nb -import numpy as np -from nilearn.image import new_img_like, resample_to_img from nipype.interfaces import freesurfer as fs from nipype.interfaces.afni import Zeropad from nipype.interfaces.base import ( BaseInterfaceInputSpec, - Directory, File, - InputMultiPath, SimpleInterface, TraitedSpec, isdefined, traits, ) from nipype.interfaces.freesurfer.base import FSCommandOpenMP, FSTraitedSpec -from nipype.interfaces.freesurfer.utils import LTAConvert -from nipype.utils.filemanip import copyfile, filename_to_list, fname_presuffix +from nipype.utils.filemanip import fname_presuffix from niworkflows.utils.images import _copyxform from scipy import ndimage -from scipy.ndimage.morphology import binary_fill_holes -from skimage import morphology as sim class FSTraitedSpecOpenMP(FSTraitedSpec): @@ -97,369 +89,6 @@ def _list_outputs(self): return outputs -class MakeMidthicknessInputSpec(fs.utils.MRIsExpandInputSpec): - graymid = InputMultiPath(desc='Existing graymid/midthickness file') - - -class MakeMidthickness(fs.MRIsExpand): - """Variation on MRIsExpand that checks for an existing midthickness/graymid - surface, and copies if available. - - mris_expand is an expensive operation, so this avoids re-running it when the - working directory is lost. - If users provide their own midthickness/graymid file, we assume they have - created it correctly. - """ - - input_spec = MakeMidthicknessInputSpec - - @property - def cmdline(self): - cmd = super().cmdline - if not isdefined(self.inputs.graymid) or len(self.inputs.graymid) < 1: - return cmd - - # Possible graymid values include {l,r}h.{graymid,midthickness} - # Prefer midthickness to graymid, require to be of the same hemisphere - # as input - source = None - in_base = op.basename(self.inputs.in_file) - mt = self._associated_file(in_base, 'midthickness') - gm = self._associated_file(in_base, 'graymid') - - for surf in self.inputs.graymid: - if op.basename(surf) == mt: - source = surf - break - if op.basename(surf) == gm: - source = surf - - if source is None: - return cmd - - return 'cp {} {}'.format(source, self._list_outputs()['out_file']) - - -class FSInjectBrainExtractedInputSpec(BaseInterfaceInputSpec): - subjects_dir = Directory(mandatory=True, desc='FreeSurfer SUBJECTS_DIR') - subject_id = traits.Str(mandatory=True, desc='Subject ID') - in_brain = File(mandatory=True, exists=True, desc='input file, part of a BIDS tree') - - -class FSInjectBrainExtractedOutputSpec(TraitedSpec): - subjects_dir = Directory(desc='FreeSurfer SUBJECTS_DIR') - subject_id = traits.Str(desc='Subject ID') - - -class FSInjectBrainExtracted(SimpleInterface): - input_spec = FSInjectBrainExtractedInputSpec - output_spec = FSInjectBrainExtractedOutputSpec - _always_run = True - - def _run_interface(self, runtime): - subjects_dir, subject_id = inject_skullstripped( - self.inputs.subjects_dir, self.inputs.subject_id, self.inputs.in_brain - ) - self._results['subjects_dir'] = subjects_dir - self._results['subject_id'] = subject_id - return runtime - - -class FSDetectInputsInputSpec(BaseInterfaceInputSpec): - t1w_list = InputMultiPath( - File(exists=True), mandatory=True, desc='input file, part of a BIDS tree' - ) - t2w_list = InputMultiPath(File(exists=True), desc='input file, part of a BIDS tree') - flair_list = InputMultiPath(File(exists=True), desc='input file, part of a BIDS tree') - hires_enabled = traits.Bool(True, usedefault=True, desc='enable hi-resolution processing') - - -class FSDetectInputsOutputSpec(TraitedSpec): - t2w = File(desc='reference T2w image') - use_t2w = traits.Bool(desc='enable use of T2w downstream computation') - flair = File(desc='reference FLAIR image') - use_flair = traits.Bool(desc='enable use of FLAIR downstream computation') - hires = traits.Bool(desc='enable hi-res processing') - mris_inflate = traits.Str(desc='mris_inflate argument') - - -class FSDetectInputs(SimpleInterface): - input_spec = FSDetectInputsInputSpec - output_spec = FSDetectInputsOutputSpec - - def _run_interface(self, runtime): - t2w, flair, self._results['hires'], mris_inflate = detect_inputs( - self.inputs.t1w_list, - t2w_list=self.inputs.t2w_list if isdefined(self.inputs.t2w_list) else None, - flair_list=self.inputs.flair_list if isdefined(self.inputs.flair_list) else None, - hires_enabled=self.inputs.hires_enabled, - ) - - self._results['use_t2w'] = t2w is not None - if self._results['use_t2w']: - self._results['t2w'] = t2w - - self._results['use_flair'] = flair is not None - if self._results['use_flair']: - self._results['flair'] = flair - - if self._results['hires']: - self._results['mris_inflate'] = mris_inflate - - return runtime - - -class TruncateLTA: - """Mixin to ensure that LTA files do not store overly long paths, - which lead to segmentation faults when read by FreeSurfer tools. - - See the following issues for discussion: - - * https://github.com/freesurfer/freesurfer/pull/180 - * https://github.com/poldracklab/fmriprep/issues/768 - * https://github.com/poldracklab/fmriprep/pull/778 - * https://github.com/poldracklab/fmriprep/issues/1268 - * https://github.com/poldracklab/fmriprep/pull/1274 - """ - - # Use a tuple in case some object produces multiple transforms - lta_outputs = ('out_lta_file',) - - def _post_run_hook(self, runtime): - outputs = self._list_outputs() - - for lta_name in self.lta_outputs: - lta_file = outputs[lta_name] - if not isdefined(lta_file): - continue - - with open(lta_file) as f: - lines = f.readlines() - - fixed = False - newfile = [] - - for line in lines: - if line.startswith('filename = ') and len(line.strip('\n')) >= 255: - fixed = True - newfile.append('filename = path_too_long\n') - else: - newfile.append(line) - - if fixed: - with open(lta_file, 'w') as f: - f.write(''.join(newfile)) - - runtime = super()._post_run_hook(runtime) - - return runtime - - -class PatchedLTAConvert(TruncateLTA, LTAConvert): - """ - LTAconvert is producing a lta file refer as out_lta - truncate filename through mixin TruncateLTA - """ - - lta_outputs = ('out_lta',) - - -class RefineBrainMaskInputSpec(BaseInterfaceInputSpec): - in_anat = File(exists=True, mandatory=True, desc='input anatomical reference (INU corrected)') - in_aseg = File(exists=True, mandatory=True, desc='input ``aseg`` file, in NifTi format.') - in_ants = File( - exists=True, - mandatory=True, - desc='brain tissue segmentation generated with antsBrainExtraction.sh', - ) - - -class RefineBrainMaskOutputSpec(TraitedSpec): - out_file = File(exists=True, desc='new mask') - - -class RefineBrainMask(SimpleInterface): - """ - Refine the brain mask implicit in the ``aseg.mgz`` - file to include possibly missing gray-matter voxels - and deep, wide sulci. - """ - - input_spec = RefineBrainMaskInputSpec - output_spec = RefineBrainMaskOutputSpec - - def _run_interface(self, runtime): - self._results['out_file'] = fname_presuffix( - self.inputs.in_anat, suffix='_rbrainmask', newpath=runtime.cwd - ) - - anatnii = nb.load(self.inputs.in_anat) - msknii = nb.Nifti1Image( - grow_mask( - anatnii.get_fdata(), - nb.load(self.inputs.in_aseg).get_fdata(), - nb.load(self.inputs.in_ants).get_fdata(), - ), - anatnii.affine, - anatnii.header, - ) - msknii.set_data_dtype(np.uint8) - msknii.to_filename(self._results['out_file']) - - return runtime - - -def inject_skullstripped(subjects_dir, subject_id, skullstripped): - mridir = op.join(subjects_dir, subject_id, 'mri') - t1 = op.join(mridir, 'T1.mgz') - bm_auto = op.join(mridir, 'brainmask.auto.mgz') - bm = op.join(mridir, 'brainmask.mgz') - - if not op.exists(bm_auto): - img = nb.load(t1) - mask = nb.load(skullstripped) - bmask = new_img_like(mask, mask.get_fdata() > 0) - resampled_mask = resample_to_img(bmask, img, 'nearest') - masked_image = new_img_like(img, img.get_fdata() * resampled_mask.get_fdata()) - masked_image.to_filename(bm_auto) - - if not op.exists(bm): - copyfile(bm_auto, bm, copy=True, use_hardlink=True) - - return subjects_dir, subject_id - - -def detect_inputs(t1w_list, t2w_list=None, flair_list=None, hires_enabled=True): - t1w_list = filename_to_list(t1w_list) - t2w_list = filename_to_list(t2w_list) if t2w_list is not None else [] - flair_list = filename_to_list(flair_list) if flair_list is not None else [] - t1w_ref = nb.load(t1w_list[0]) - # Use high resolution preprocessing if voxel size < 1.0mm - # Tolerance of 0.05mm requires that rounds down to 0.9mm or lower - hires = hires_enabled and max(t1w_ref.header.get_zooms()) < 1 - 0.05 - - t2w = None - if t2w_list and max(nb.load(t2w_list[0]).header.get_zooms()) < 1.2: - t2w = t2w_list[0] - - # Prefer T2w to FLAIR if both present and T2w satisfies - flair = None - if flair_list and not t2w and max(nb.load(flair_list[0]).header.get_zooms()) < 1.2: - flair = flair_list[0] - - # https://surfer.nmr.mgh.harvard.edu/fswiki/SubmillimeterRecon - mris_inflate = '-n 50' if hires else None - return (t2w, flair, hires, mris_inflate) - - -def refine_aseg(aseg, ball_size=4): - """ - First step to reconcile ANTs' and FreeSurfer's brain masks. - - Here, the ``aseg.mgz`` mask from FreeSurfer is refined in two - steps, using binary morphological operations: - - 1. With a binary closing operation the sulci are included - into the mask. This results in a smoother brain mask - that does not exclude deep, wide sulci. - - 2. Fill any holes (typically, there could be a hole next to - the pineal gland and the corpora quadrigemina if the great - cerebral brain is segmented out). - - - """ - # Read aseg data - bmask = aseg.copy() - bmask[bmask > 0] = 1 - bmask = bmask.astype(np.uint8) - - # Morphological operations - selem = sim.ball(ball_size) - newmask = sim.binary_closing(bmask, selem) - newmask = binary_fill_holes(newmask.astype(np.uint8), selem).astype(np.uint8) - - return newmask.astype(np.uint8) - - -def grow_mask(anat, aseg, ants_segs=None, ww=7, zval=2.0, bw=4): - """ - Grow mask including pixels that have a high likelihood. - GM tissue parameters are sampled in image patches of ``ww`` size. - - This is inspired on mindboggle's solution to the problem: - https://github.com/nipy/mindboggle/blob/master/mindboggle/guts/segment.py#L1660 - - """ - selem = sim.ball(bw) - - if ants_segs is None: - ants_segs = np.zeros_like(aseg, dtype=np.uint8) - - aseg[aseg == 42] = 3 # Collapse both hemispheres - gm = anat.copy() - gm[aseg != 3] = 0 - - refined = refine_aseg(aseg) - newrefmask = sim.binary_dilation(refined, selem) - refined - indices = np.argwhere(newrefmask > 0) - for pixel in indices: - # When ATROPOS identified the pixel as GM, set and carry on - if ants_segs[tuple(pixel)] == 2: - refined[tuple(pixel)] = 1 - continue - - window = gm[ - pixel[0] - ww : pixel[0] + ww, - pixel[1] - ww : pixel[1] + ww, - pixel[2] - ww : pixel[2] + ww, - ] - if np.any(window > 0): - mu = window[window > 0].mean() - sigma = max(window[window > 0].std(), 1.0e-5) - zstat = abs(anat[tuple(pixel)] - mu) / sigma - refined[tuple(pixel)] = int(zstat < zval) - - refined = sim.binary_opening(refined, selem) - return refined - - -def medial_wall_to_nan(in_file, subjects_dir, target_subject, newpath=None): - """Convert values on medial wall to NaNs""" - import os - - import nibabel as nb - import numpy as np - - fn = os.path.basename(in_file) - if not target_subject.startswith('fs'): - return in_file - - cortex = nb.freesurfer.read_label( - os.path.join(subjects_dir, target_subject, 'label', f'{fn[:2]}.cortex.label') - ) - func = nb.load(in_file) - medial = np.delete(np.arange(len(func.darrays[0].data)), cortex) - for darray in func.darrays: - darray.data[medial] = np.nan - - out_file = os.path.join(newpath or os.getcwd(), fn) - func.to_filename(out_file) - return out_file - - -def find_fs_path(freesurfer_dir, subject_id): - if freesurfer_dir is None: - return None - nosub = op.join(freesurfer_dir, subject_id) - if op.exists(nosub): - return Path(nosub) - withsub = op.join(freesurfer_dir, 'sub-' + subject_id) - if op.exists(withsub): - return Path(withsub) - return None - - class _PrepareSynthStripGridInputSpec(BaseInterfaceInputSpec): input_image = File(exists=True, mandatory=True) diff --git a/qsiprep/interfaces/surf.py b/qsiprep/interfaces/surf.py deleted file mode 100644 index adf952d0..00000000 --- a/qsiprep/interfaces/surf.py +++ /dev/null @@ -1,154 +0,0 @@ -# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*- -# vi: set ft=python sts=4 ts=4 sw=4 et: -""" -Handling surfaces ------------------ - -""" - -import os - -import nibabel as nb -import numpy as np -from nipype.interfaces.base import ( - BaseInterfaceInputSpec, - File, - SimpleInterface, - TraitedSpec, - isdefined, -) - - -class NormalizeSurfInputSpec(BaseInterfaceInputSpec): - in_file = File(mandatory=True, exists=True, desc='Freesurfer-generated GIFTI file') - transform_file = File(exists=True, desc='FSL or LTA affine transform file') - - -class NormalizeSurfOutputSpec(TraitedSpec): - out_file = File(desc='output file with re-centered GIFTI coordinates') - - -class NormalizeSurf(SimpleInterface): - """ Normalizes a FreeSurfer-generated GIFTI image - - FreeSurfer includes an offset to the center of the brain volume that is not - respected by all software packages. - Normalization involves adding this offset to the coordinates of all - vertices, and zeroing out that offset, to ensure consistent behavior - across software packages. - In particular, this normalization is consistent with the Human Connectome - Project pipeline (see `AlgorithmSurfaceApplyAffine`_ and - `FreeSurfer2CaretConvertAndRegisterNonlinear`_), although the the HCP - may not zero out the offset. - - GIFTI files with ``midthickness``/``graymid`` in the name are also updated - to include the following metadata entries:: - - { - AnatomicalStructureSecondary: MidThickness, - GeometricType: Anatomical - } - - This interface is intended to be applied uniformly to GIFTI surface files - generated from the ``?h.white``/``?h.smoothwm`` and ``?h.pial`` surfaces, - as well as externally-generated ``?h.midthickness``/``?h.graymid`` files. - In principle, this should apply safely to any other surface, although it is - less relevant to surfaces that don't describe an anatomical structure. - - .. _AlgorithmSurfaceApplyAffine: https://github.com/Washington-University/workbench\ -/blob/1b79e56/src/Algorithms/AlgorithmSurfaceApplyAffine.cxx#L73-L91 - - .. _FreeSurfer2CaretConvertAndRegisterNonlinear: https://github.com/Washington-University/\ -Pipelines/blob/ae69b9a/PostFreeSurfer/scripts/FreeSurfer2CaretConvertAndRegisterNonlinear.sh\ -#L147-154 - - """ - - input_spec = NormalizeSurfInputSpec - output_spec = NormalizeSurfOutputSpec - - def _run_interface(self, runtime): - transform_file = self.inputs.transform_file - if not isdefined(transform_file): - transform_file = None - self._results['out_file'] = normalize_surfs( - self.inputs.in_file, transform_file, newpath=runtime.cwd - ) - return runtime - - -def normalize_surfs(in_file, transform_file, newpath=None): - """Re-center GIFTI coordinates to fit align to native T1 space - - For midthickness surfaces, add MidThickness metadata - - Coordinate update based on: - https://github.com/Washington-University/workbench/blob/1b79e56/src/Algorithms/AlgorithmSurfaceApplyAffine.cxx#L73-L91 - and - https://github.com/Washington-University/Pipelines/blob/ae69b9a/PostFreeSurfer/scripts/FreeSurfer2CaretConvertAndRegisterNonlinear.sh#L147 - """ - - img = nb.load(in_file) - transform = load_transform(transform_file) - pointset = img.get_arrays_from_intent('NIFTI_INTENT_POINTSET')[0] - coords = pointset.data.T - c_ras_keys = ('VolGeomC_R', 'VolGeomC_A', 'VolGeomC_S') - ras = np.array([[float(pointset.metadata[key])] for key in c_ras_keys]) - ones = np.ones((1, coords.shape[1]), dtype=coords.dtype) - # Apply C_RAS translation to coordinates, then transform - pointset.data = transform.dot(np.vstack((coords + ras, ones)))[:3].T.astype(coords.dtype) - - secondary = nb.gifti.GiftiNVPairs('AnatomicalStructureSecondary', 'MidThickness') - geom_type = nb.gifti.GiftiNVPairs('GeometricType', 'Anatomical') - has_ass = has_geo = False - for nvpair in pointset.meta.data: - # Remove C_RAS translation from metadata to avoid double-dipping in FreeSurfer - if nvpair.name in c_ras_keys: - nvpair.value = '0.000000' - # Check for missing metadata - elif nvpair.name == secondary.name: - has_ass = True - elif nvpair.name == geom_type.name: - has_geo = True - fname = os.path.basename(in_file) - # Update metadata for MidThickness/graymid surfaces - if 'midthickness' in fname.lower() or 'graymid' in fname.lower(): - if not has_ass: - pointset.meta.data.insert(1, secondary) - if not has_geo: - pointset.meta.data.insert(2, geom_type) - - if newpath is not None: - newpath = os.getcwd() - out_file = os.path.join(newpath, fname) - img.to_filename(out_file) - return out_file - - -def load_transform(fname): - """Load affine transform from file - - Parameters - ---------- - fname : str or None - Filename of an LTA or FSL-style MAT transform file. - If ``None``, return an identity transform - - Returns - ------- - affine : (4, 4) numpy.ndarray - """ - if fname is None: - return np.eye(4) - - if fname.endswith('.mat'): - return np.loadtxt(fname) - elif fname.endswith('.lta'): - with open(fname, 'rb') as fobj: - for line in fobj: - if line.startswith(b'1 4 4'): - break - lines = fobj.readlines()[:4] - return np.genfromtxt(lines) - - raise ValueError('Unknown transform type; pass FSL (.mat) or LTA (.lta)') diff --git a/qsiprep/workflows/dwi/base.py b/qsiprep/workflows/dwi/base.py index 5c97f921..39d2f247 100644 --- a/qsiprep/workflows/dwi/base.py +++ b/qsiprep/workflows/dwi/base.py @@ -85,12 +85,6 @@ def init_dwi_preproc_wf( FreeSurfer SUBJECTS_DIR subject_id FreeSurfer subject ID - t1_2_fsnative_forward_transform - LTA-style affine matrix translating from T1w to - FreeSurfer-conformed subject space - t1_2_fsnative_reverse_transform - LTA-style affine matrix translating from FreeSurfer-conformed - subject space to T1w dwi_sampling_grid A NIfTI1 file with the grid spacing and FoV to resample the DWIs @@ -201,8 +195,6 @@ def init_dwi_preproc_wf( 't1_2_mni_forward_transform', 't2w_unfatsat', 't1_2_mni_reverse_transform', - 't1_2_fsnative_forward_transform', - 't1_2_fsnative_reverse_transform', 't2w_files', 'dwi_sampling_grid', ] @@ -429,7 +421,6 @@ def init_dwi_preproc_wf( ('t1_seg', 'inputnode.t1_seg'), ('subjects_dir', 'inputnode.subjects_dir'), ('subject_id', 'inputnode.subject_id'), - ('t1_2_fsnative_reverse_transform', 'inputnode.t1_2_fsnative_reverse_transform'), ]), (hmc_wf, b0_coreg_wf, [('outputnode.b0_template', 'inputnode.ref_b0_brain')]), (hmc_wf, summary, [('outputnode.sdc_method', 'distortion_correction')]), diff --git a/qsiprep/workflows/dwi/finalize.py b/qsiprep/workflows/dwi/finalize.py index 2c7152bf..9f241975 100644 --- a/qsiprep/workflows/dwi/finalize.py +++ b/qsiprep/workflows/dwi/finalize.py @@ -109,12 +109,6 @@ def init_dwi_finalize_wf( FreeSurfer SUBJECTS_DIR subject_id FreeSurfer subject ID - t1_2_fsnative_forward_transform - LTA-style affine matrix translating from T1w to - FreeSurfer-conformed subject space - t1_2_fsnative_reverse_transform - LTA-style affine matrix translating from FreeSurfer-conformed - subject space to T1w dwi_sampling_grid A NIfTI1 file with the grid spacing and FoV to resample the DWIs b0_ref_image @@ -202,8 +196,6 @@ def init_dwi_finalize_wf( 't1_aseg', 't1_aparc', 't1_2_mni_reverse_transform', - 't1_2_fsnative_forward_transform', - 't1_2_fsnative_reverse_transform', 'dwi_sampling_grid', 'raw_qc_file', 'coreg_score', diff --git a/qsiprep/workflows/dwi/intramodal_template.py b/qsiprep/workflows/dwi/intramodal_template.py index 9ee8d192..45ba033e 100644 --- a/qsiprep/workflows/dwi/intramodal_template.py +++ b/qsiprep/workflows/dwi/intramodal_template.py @@ -77,8 +77,6 @@ def init_intramodal_template_wf( 't1_tpms', 't1_2_mni_forward_transform', 'dwi_sampling_grid', - 't1_2_fsnative_forward_transform', - 't1_2_fsnative_reverse_transform', 't1_2_mni_reverse_transform', ] ), @@ -147,7 +145,6 @@ def init_intramodal_template_wf( ('subjects_dir', 'inputnode.subjects_dir'), ('t1_seg', 'inputnode.t1_seg'), ('subject_id', 'inputnode.subject_id'), - ('t1_2_fsnative_reverse_transform', 'inputnode.t1_2_fsnative_reverse_transform'), ]), (ants_mvtc2, b0_coreg_wf, [('templates', 'inputnode.ref_b0_brain')]), (b0_coreg_wf, ds_report_imtcoreg, [('outputnode.report', 'in_file')]), diff --git a/qsiprep/workflows/dwi/registration.py b/qsiprep/workflows/dwi/registration.py index 661df7a2..7fddd2c1 100644 --- a/qsiprep/workflows/dwi/registration.py +++ b/qsiprep/workflows/dwi/registration.py @@ -56,8 +56,6 @@ def init_b0_to_anat_registration_wf( FreeSurfer SUBJECTS_DIR subject_id FreeSurfer subject ID - t1_2_fsnative_reverse_transform - LTA-style affine matrix translating from FreeSurfer-conformed subject space to T1w Outputs ------- @@ -81,7 +79,6 @@ def init_b0_to_anat_registration_wf( 't1_seg', 'subjects_dir', 'subject_id', - 't1_2_fsnative_reverse_transform', ] ), name='inputnode', @@ -175,8 +172,6 @@ def init_direct_b0_acpc_wf(write_report=True, name='b0_anat_coreg'): FreeSurfer SUBJECTS_DIR subject_id FreeSurfer subject ID - t1_2_fsnative_reverse_transform - LTA-style affine matrix translating from FreeSurfer-conformed subject space to T1w **Outputs** @@ -197,7 +192,6 @@ def init_direct_b0_acpc_wf(write_report=True, name='b0_anat_coreg'): 't1_seg', 'subjects_dir', 'subject_id', - 't1_2_fsnative_reverse_transform', ] ), name='inputnode',