Exemple #1
0
    def response_pipeline(self, **name_maps):  # @UnusedVariable
        """
        Estimates the fibre orientation distribution (FOD) using constrained
        spherical deconvolution

        Parameters
        ----------
        response_algorithm : str
            Algorithm used to estimate the response
        """
#         outputs = [FilesetSpec('wm_response', text_format)]
#         if self.branch('response_algorithm', ('dhollander', 'msmt_5tt')):
#             outputs.append(FilesetSpec('gm_response', text_format))
#             outputs.append(FilesetSpec('csf_response', text_format))

#             inputs=[FilesetSpec('bias_correct', nifti_gz_format),
#                     FilesetSpec('grad_dirs', fsl_bvecs_format),
#                     FilesetSpec('bvalues', fsl_bvals_format),
#                     FilesetSpec('brain_mask', nifti_gz_format)],
#             outputs=outputs,

        pipeline = self.new_pipeline(
            name='response',
            desc=("Estimates the fibre response function"),
            references=[mrtrix_cite],
            name_maps=name_maps)
        # Create fod fit node
        response = pipeline.add(
            'response',
            ResponseSD(),
            requirements=[mrtrix_req.v('3.0rc3')])
        response.inputs.algorithm = self.parameter('response_algorithm')
        # Gradient merge node
        fsl_grads = pipeline.add(
            "fsl_grads",
            MergeTuple(2))
        # Connect nodes
        pipeline.connect(fsl_grads, 'out', response, 'grad_fsl')
        # Connect to inputs
        pipeline.connect_input('grad_dirs', fsl_grads, 'in1')
        pipeline.connect_input('bvalues', fsl_grads, 'in2')
        pipeline.connect_input('bias_correct', response, 'in_file')
        pipeline.connect_input('brain_mask', response, 'in_mask')
        # Connect to outputs
        pipeline.connect_output('wm_response', response, 'wm_file')
        if self.multi_tissue:
            response.inputs.gm_file = 'gm.txt'
            response.inputs.csf_file = 'csf.txt'
            pipeline.connect_output('gm_response', response, 'gm_file')
            pipeline.connect_output('csf_response', response, 'csf_file')
        # Check inputs/output are connected
        return pipeline
Exemple #2
0
    def response_pipeline(self, **kwargs):  # @UnusedVariable
        """
        Estimates the fibre orientation distribution (FOD) using constrained
        spherical deconvolution

        Parameters
        ----------
        response_algorithm : str
            Algorithm used to estimate the response
        """
        outputs = [DatasetSpec('wm_response', text_format)]
        if self.multi_tissue:
            outputs.append(DatasetSpec('gm_response', text_format))
            outputs.append(DatasetSpec('csf_response', text_format))
        pipeline = self.create_pipeline(
            name='response',
            inputs=[
                DatasetSpec('bias_correct', nifti_gz_format),
                DatasetSpec('grad_dirs', fsl_bvecs_format),
                DatasetSpec('bvalues', fsl_bvals_format),
                DatasetSpec('brain_mask', nifti_gz_format)
            ],
            outputs=outputs,
            desc=("Estimates the fibre response function"),
            version=1,
            citations=[mrtrix_cite],
            **kwargs)
        # Create fod fit node
        response = pipeline.create_node(ResponseSD(),
                                        name='response',
                                        requirements=[mrtrix3_req])
        response.inputs.algorithm = self.switch('response_algorithm')
        # Gradient merge node
        fsl_grads = pipeline.create_node(MergeTuple(2), name="fsl_grads")
        # Connect nodes
        pipeline.connect(fsl_grads, 'out', response, 'grad_fsl')
        # Connect to inputs
        pipeline.connect_input('grad_dirs', fsl_grads, 'in1')
        pipeline.connect_input('bvalues', fsl_grads, 'in2')
        pipeline.connect_input('bias_correct', response, 'in_file')
        pipeline.connect_input('brain_mask', response, 'in_mask')
        # Connect to outputs
        pipeline.connect_output('wm_response', response, 'wm_file')
        if self.multi_tissue:
            response.inputs.gm_file = 'gm.txt'
            response.inputs.csf_file = 'csf.txt'
            pipeline.connect_output('gm_response', response, 'gm_file')
            pipeline.connect_output('csf_response', response, 'csf_file')
        # Check inputs/output are connected
        return pipeline
Exemple #3
0
    def response_pipeline(self, **name_maps):
        """
        Estimates the fibre orientation distribution (FOD) using constrained
        spherical deconvolution

        Parameters
        ----------
        response_algorithm : str
            Algorithm used to estimate the response
        """

        pipeline = self.new_pipeline(
            name='response',
            desc=("Estimates the fibre response function"),
            citations=[mrtrix_cite],
            name_maps=name_maps)

        # Create fod fit node
        response = pipeline.add(
            'response',
            ResponseSD(
                algorithm=self.parameter('response_algorithm')),
            inputs={
                'grad_fsl': self.fsl_grads(pipeline),
                'in_file': (self.series_preproc_spec_name, nifti_gz_format),
                'in_mask': (self.brain_mask_spec_name, nifti_gz_format)},
            outputs={
                'wm_response': ('wm_file', text_format)},
            requirements=[mrtrix_req.v('3.0rc3')])

        # Connect to outputs
        if self.multi_tissue:
            response.inputs.gm_file = 'gm.txt',
            response.inputs.csf_file = 'csf.txt',
            pipeline.connect_output('gm_response', response, 'gm_file',
                                    text_format)
            pipeline.connect_output('csf_response', response, 'csf_file',
                                    text_format)

        return pipeline
    "FSL Anatomical Processing Script": {FslAnat.__version__: FslAnat},
    "mean_image": {MeanImage().version: MeanImage},
    "robustfov": {RobustFOV().version: RobustFOV},
    "ReconAll": {ReconAll().version: ReconAll},
    "SUSAN": {SUSAN().version: SUSAN},
    "topup": {TopupWrapper.version: TopupWrapper},
    "eddy": {Eddy().version: Eddy},
    "denoise": {DWIDenoise().version: DWIDenoise},
    "degibbs": {MRDeGibbs().version: MRDeGibbs},
    "bias_correct": {DWIBiasCorrect().version: DWIBiasCorrect},
    "dwifslpreproc": {DwiFslPreproc.__version__: DwiFslPreproc},
    "mrconvert": {MRConvert.__version__: MRConvert},
    "dwi2fod": {
        ConstrainedSphericalDeconvolution().version: ConstrainedSphericalDeconvolution  # noqa: E501
    },
    "dwi2response": {ResponseSD().version: ResponseSD},
    "5ttgen": {Generate5tt().version: Generate5tt},
    "dwi2tensor": {Dwi2Tensor.__version__: Dwi2Tensor},
    "tensor2metric": {Tensor2metric.__version__: Tensor2metric},
    "mrcat": {MRCat.__version__: MRCat},
    "dwigradcheck": {DwiGradCheck.__version__: DwiGradCheck},
    "Mutual Information Score": {"1.0": MutualInformationScore},
    "fMRIPrep": {
        FmriPrep2021.__version__: FmriPrep2021,
        FmriPrep2022.__version__: FmriPrep2022,
        FmriPrep2023.__version__: FmriPrep2023,
        FmriPrep2024.__version__: FmriPrep2024,
        FmriPrep2025.__version__: FmriPrep2025,
    },
}
     "versions": [{
         "title": ConstrainedSphericalDeconvolution().version or "1.0",
         "description":
         f"Default ConstrainedSphericalDeconvolution version for nipype {_NIPYPE_VERSION}.",  # noqa: E501
         "input": DWI2FOD_INPUT_SPECIFICATION,
         "output": DWI2FOD_OUTPUT_SPECIFICATION,
         "nested_results_attribute": "outputs.get_traitsfree",
     }],
 },
 {
     "title":
     "dwi2response",
     "description":
     "Estimate response function(s) for spherical deconvolution using the specified algorithm.",  # noqa: E501
     "versions": [{
         "title": ResponseSD().version or "1.0",
         "description":
         f"Default ResponseSD version for nipype {_NIPYPE_VERSION}.",  # noqa: E501
         "input": DWI2RESPONSE_INPUT_SPECIFICATION,
         "output": DWI2RESPONSE_OUTPUT_SPECIFICATION,
         "nested_results_attribute": "outputs.get_traitsfree",
     }],
 },
 {
     "title":
     "5ttgen",
     "description":
     "Generate a 5TT image suitable for ACT using the selected algorithm.",  # noqa: E501
     "versions": [{
         "title": Generate5tt().version or "1.0",
         "description":