Commit 0c67c770 by arnaud.marcoux

Add pet-surface pipeline

parent 021ddd3a
Pipeline #900 passed with stages
in 30 seconds
......@@ -131,6 +131,7 @@ def execute():
from clinica.pipelines.fmri_preprocessing.fmri_preprocessing_cli import fMRIPreprocessingCLI # noqa
from clinica.pipelines.pet_volume.pet_volume_cli import PETVolumeCLI # noqa
from clinica.pipelines.statistics_surface.statistics_surface_cli import StatisticsSurfaceCLI # noqa
from clinica.pipelines.pet_surface.pet_surface_cli import PetSurfaceCLI # noqa
pipelines = ClinicaClassLoader(baseclass=CmdParser,
......@@ -148,7 +149,8 @@ def execute():
DWIProcessingDTICLI(),
fMRIPreprocessingCLI(),
PETVolumeCLI(),
StatisticsSurfaceCLI()
StatisticsSurfaceCLI(),
PetSurfaceCLI()
]
run_parser = sub_parser.add_parser(
......
# pet_cortical_projection
\ No newline at end of file
function applyInverseDeformationField(target, deformation_field, img, output_folder, output_prefix)
%% Generated by nipype.interfaces.spm
if isempty(which('spm'))
throw(MException('SPMCheck:NotFound', 'SPM not in matlab path'));
end
[name, version] = spm('ver');
fprintf('SPM version: %s Release: %s\n',name, version);
fprintf('SPM path: %s\n', which('spm'));
spm('Defaults','fMRI');
if strcmp(name, 'SPM8') || strcmp(name(1:5), 'SPM12')
spm_jobman('initcfg');
spm_get_defaults('cmdline', 1);
end
jobs{1}.spm.util.defs.comp{1}.inv.comp{1}.def = {deformation_field};
jobs{1}.spm.util.defs.comp{1}.inv.space = {target};
jobs{1}.spm.util.defs.out{1}.pull.fnames = {img};
jobs{1}.spm.util.defs.out{1}.pull.savedir.saveusr = {output_folder};
jobs{1}.spm.util.defs.out{1}.pull.interp = 4;
jobs{1}.spm.util.defs.out{1}.pull.mask = 1;
jobs{1}.spm.util.defs.out{1}.pull.fwhm = [0 0 0];
jobs{1}.spm.util.defs.out{1}.pull.prefix = output_prefix;
spm_jobman('run', jobs);
end
\ No newline at end of file
{
"id": "aramislab/pet_surface",
"author": "MARCOUX Arnaud",
"version": "0.1",
"dependencies": [
{
"type": "binary",
"name": "clinica",
"version": ">=0.1.0"
},
{
"type": "software",
"name": "freesurfer",
"version": ">=6"
}
]
}
# coding: utf-8
import clinica.engine as ce
__author__ = "Arnaud Marcoux"
__copyright__ = "Copyright 2016-2018 The Aramis Lab Team"
__credits__ = ["Arnaud Marcoux", "Michael Bacci"]
__license__ = "See LICENSE.txt file"
__version__ = "1.0.0"
__maintainer__ = "Arnaud Marcoux"
__email__ = "arnaud.marcoux@inria.fr"
__status__ = "Development"
class PetSurfaceCLI(ce.CmdParser):
def define_name(self):
"""Define the sub-command name to run this pipeline.
"""
self._name = 'pet-surface'
def define_description(self):
"""Define a description of this pipeline.
"""
self._description = 'Surface-based processing of PET images:\nhttps://gitlab.icm-institute.org/aramislab/clinica-aramis/wikis/docs/Pipelines/PET_CorticalProjection'
def define_options(self):
"""Define the sub-command arguments
"""
self._args.add_argument("bids_directory",
help='Path to the BIDS directory.')
self._args.add_argument("caps_directory",
help='Path to the CAPS directory. (Filled with results from t1-freesurfer')
self._args.add_argument("-tsv", "--subjects_sessions_tsv",
help='TSV file containing the subjects with their sessions.')
self._args.add_argument("-pt", "--pet_tracer", type=str, default='fdg',
help='PET tracer type. Can be fdg or av45. Default value : fdg')
self._args.add_argument("-wd", "--working_directory",
help='Temporary directory to store pipeline intermediate results')
self._args.add_argument("-np", "--n_procs", type=int,
help='Number of cores used to run in parallel')
def run_command(self, args):
from tempfile import mkdtemp
from pet_surface_pipeline import PetSurface
if args.working_directory is None:
args.working_directory = mkdtemp()
pipeline = PetSurface(
bids_directory=self.absolute_path(args.bids_directory),
caps_directory=self.absolute_path(args.caps_directory),
tsv_file=self.absolute_path(args.subjects_sessions_tsv))
pipeline.parameters = {
'pet_type': args.pet_tracer,
'wd': self.absolute_path(args.working_directory),
'n_procs': args.n_procs
}
pipeline.base_dir = self.absolute_path(mkdtemp())
if args.n_procs:
pipeline.run(plugin='MultiProc', plugin_args={'n_procs': args.n_procs})
else:
pipeline.run()
......@@ -183,4 +183,4 @@ def check_matlab():
from clinica.utils.stream import cprint
if not is_binary_present("matlab"):
raise RuntimeError('Matlab was not found in PATH environment. Did you add it?)
raise RuntimeError('Matlab was not found in PATH environment. Did you add it?')
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment