Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
clinica
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
15
Issues
15
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
aramislab
clinica
Commits
fde9a5e7
Commit
fde9a5e7
authored
Sep 05, 2018
by
Mauricio Diaz
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'noMatlabDep'. Adds options to run pipelines using SPM
standalone.
parents
579ba2d4
2d1fee5c
Pipeline
#1482
passed with stages
in 1 minute 47 seconds
Changes
8
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
144 additions
and
43 deletions
+144
-43
fmri_preprocessing_pipeline.py
...pelines/fmri_preprocessing/fmri_preprocessing_pipeline.py
+1
-1
fmri_preprocessing_utils.py
.../pipelines/fmri_preprocessing/fmri_preprocessing_utils.py
+10
-1
pet_volume_pipeline.py
clinica/pipelines/pet_volume/pet_volume_pipeline.py
+12
-0
t1_volume_create_dartel_pipeline.py
..._volume_create_dartel/t1_volume_create_dartel_pipeline.py
+29
-8
t1_volume_dartel2mni_pipeline.py
...nes/t1_volume_dartel2mni/t1_volume_dartel2mni_pipeline.py
+29
-8
t1_volume_existing_template_utils.py
...me_existing_template/t1_volume_existing_template_utils.py
+8
-0
t1_volume_new_template_pipeline.py
...t1_volume_new_template/t1_volume_new_template_pipeline.py
+28
-13
t1_volume_tissue_segmentation_pipeline.py
...ue_segmentation/t1_volume_tissue_segmentation_pipeline.py
+27
-12
No files found.
clinica/pipelines/fmri_preprocessing/fmri_preprocessing_pipeline.py
View file @
fde9a5e7
...
@@ -275,7 +275,7 @@ class fMRIPreprocessing(cpe.Pipeline):
...
@@ -275,7 +275,7 @@ class fMRIPreprocessing(cpe.Pipeline):
import
nipype.interfaces.spm
as
spm
import
nipype.interfaces.spm
as
spm
import
nipype.pipeline.engine
as
npe
import
nipype.pipeline.engine
as
npe
from
clinica.utils.io
import
zip_nii
,
unzip_nii
from
clinica.utils.io
import
zip_nii
,
unzip_nii
# Zipping
# Zipping
# =======
# =======
unzip_node
=
npe
.
MapNode
(
name
=
'Unzipping'
,
unzip_node
=
npe
.
MapNode
(
name
=
'Unzipping'
,
...
...
clinica/pipelines/fmri_preprocessing/fmri_preprocessing_utils.py
View file @
fde9a5e7
"""
"""
"""
"""
from
__future__
import
print_function
,
division
,
unicode_literals
,
absolute_import
from
__future__
import
print_function
,
division
,
unicode_literals
,
absolute_import
from
nipype.utils.filemanip
import
(
fname_presuffix
,
filename_to_list
,
list_to_filename
)
from
nipype.utils.filemanip
import
(
fname_presuffix
,
filename_to_list
,
list_to_filename
)
...
@@ -11,6 +11,15 @@ import nipype.pipeline.engine as npe
...
@@ -11,6 +11,15 @@ import nipype.pipeline.engine as npe
import
nipype.interfaces.spm
as
spm
import
nipype.interfaces.spm
as
spm
import
nipype.interfaces.fsl
as
fsl
import
nipype.interfaces.fsl
as
fsl
import
os
if
'SPMSTANDALONE_HOME'
in
os
.
environ
:
if
'MCR_HOME'
in
os
.
environ
:
matlab_cmd
=
os
.
path
.
join
(
os
.
environ
[
'SPMSTANDALONE_HOME'
],
'/run_spm12.sh'
)
\
+
' '
+
os
.
environ
[
'MCR_HOME'
]
\
+
' script'
spm
.
SPMCommand
.
set_mlab_paths
(
matlab_cmd
=
matlab_cmd
,
use_mcr
=
True
)
class
RealignUnwarpInputSpec
(
SPMCommandInputSpec
):
class
RealignUnwarpInputSpec
(
SPMCommandInputSpec
):
scans
=
traits
.
Either
(
traits
.
List
(
File
(
exists
=
True
)),
File
(
exists
=
True
),
scans
=
traits
.
Either
(
traits
.
List
(
File
(
exists
=
True
)),
File
(
exists
=
True
),
...
...
clinica/pipelines/pet_volume/pet_volume_pipeline.py
View file @
fde9a5e7
...
@@ -357,6 +357,18 @@ class PETVolume(cpe.Pipeline):
...
@@ -357,6 +357,18 @@ class PETVolume(cpe.Pipeline):
from
clinica.utils.io
import
unzip_nii
from
clinica.utils.io
import
unzip_nii
import
clinica.pipelines.pet_volume.pet_volume_utils
as
utils
import
clinica.pipelines.pet_volume.pet_volume_utils
as
utils
import
os
if
'SPMSTANDALONE_HOME'
in
os
.
environ
:
if
'MCR_HOME'
in
os
.
environ
:
matlab_cmd
=
os
.
path
.
join
(
os
.
environ
[
'SPMSTANDALONE_HOME'
],
'/run_spm12.sh'
)
\
+
' '
+
os
.
environ
[
'MCR_HOME'
]
\
+
' script'
spm
.
SPMCommand
.
set_mlab_paths
(
matlab_cmd
=
matlab_cmd
,
use_mcr
=
True
)
# Unzipping
# Unzipping
# =========
# =========
unzip_pet_image
=
npe
.
Node
(
nutil
.
Function
(
input_names
=
[
'in_file'
],
unzip_pet_image
=
npe
.
Node
(
nutil
.
Function
(
input_names
=
[
'in_file'
],
...
...
clinica/pipelines/t1_volume_create_dartel/t1_volume_create_dartel_pipeline.py
View file @
fde9a5e7
...
@@ -193,17 +193,38 @@ class T1VolumeCreateDartel(cpe.Pipeline):
...
@@ -193,17 +193,38 @@ class T1VolumeCreateDartel(cpe.Pipeline):
mlab
.
MatlabCommand
.
set_default_matlab_cmd
(
mlab_home
)
mlab
.
MatlabCommand
.
set_default_matlab_cmd
(
mlab_home
)
mlab
.
MatlabCommand
.
set_default_paths
(
spm_home
)
mlab
.
MatlabCommand
.
set_default_paths
(
spm_home
)
version
=
spm
.
Info
.
version
()
if
'SPMSTANDALONE_HOME'
in
os
.
environ
:
if
'MCR_HOME'
in
os
.
environ
:
matlab_cmd
=
os
.
path
.
join
(
os
.
environ
[
'SPMSTANDALONE_HOME'
],
'run_spm12.sh'
)
\
+
' '
+
os
.
environ
[
'MCR_HOME'
]
\
+
' script'
spm
.
SPMCommand
.
set_mlab_paths
(
matlab_cmd
=
matlab_cmd
,
use_mcr
=
True
)
version
=
spm
.
SPMCommand
()
.
version
else
:
version
=
spm
.
Info
.
version
()
if
version
:
if
version
:
if
version
[
'name'
]
==
'SPM8'
:
if
isinstance
(
version
,
dict
):
print
'You are using SPM version 8. The recommended version to use with Clinica is SPM 12. '
\
spm_path
=
version
[
'path'
]
'Please upgrade your SPM toolbox.'
if
version
[
'name'
]
==
'SPM8'
:
elif
version
[
'name'
]
!=
'SPM12'
:
print
'You are using SPM version 8. The recommended version to use with Clinica is SPM 12. '
\
raise
RuntimeError
(
'SPM version 8 or 12 could not be found. Please upgrade your SPM toolbox.'
)
'Please upgrade your SPM toolbox.'
tissue_map
=
os
.
path
.
join
(
spm_path
,
'toolbox/Seg/TPM.nii'
)
elif
version
[
'name'
]
==
'SPM12'
:
tissue_map
=
os
.
path
.
join
(
spm_path
,
'tpm/TPM.nii'
)
else
:
raise
RuntimeError
(
'SPM version 8 or 12 could not be found. Please upgrade your SPM toolbox.'
)
if
isinstance
(
version
,
unicode
):
if
version
==
'12.7169'
:
tissue_map
=
os
.
path
.
join
(
unicode
(
spm_home
),
'spm12_mcr/spm/spm12/tpm/TPM.nii'
)
else
:
raise
RuntimeError
(
'SPM standalone version not supported. Please upgrade SPM standalone.'
)
else
:
else
:
raise
RuntimeError
(
'SPM could not be found. Please verify your SPM_HOME environment variable.'
)
raise
RuntimeError
(
'SPM could not be found. Please verify your SPM_HOME environment variable.'
)
# Unzipping
# Unzipping
# =========
# =========
unzip_node
=
npe
.
MapNode
(
nutil
.
Function
(
input_names
=
[
'in_file'
],
unzip_node
=
npe
.
MapNode
(
nutil
.
Function
(
input_names
=
[
'in_file'
],
...
...
clinica/pipelines/t1_volume_dartel2mni/t1_volume_dartel2mni_pipeline.py
View file @
fde9a5e7
...
@@ -241,17 +241,38 @@ class T1VolumeDartel2MNI(cpe.Pipeline):
...
@@ -241,17 +241,38 @@ class T1VolumeDartel2MNI(cpe.Pipeline):
mlab
.
MatlabCommand
.
set_default_matlab_cmd
(
mlab_home
)
mlab
.
MatlabCommand
.
set_default_matlab_cmd
(
mlab_home
)
mlab
.
MatlabCommand
.
set_default_paths
(
spm_home
)
mlab
.
MatlabCommand
.
set_default_paths
(
spm_home
)
version
=
spm
.
Info
.
version
()
if
'SPMSTANDALONE_HOME'
in
os
.
environ
:
if
'MCR_HOME'
in
os
.
environ
:
matlab_cmd
=
os
.
path
.
join
(
os
.
environ
[
'SPMSTANDALONE_HOME'
],
'run_spm12.sh'
)
\
+
' '
+
os
.
environ
[
'MCR_HOME'
]
\
+
' script'
spm
.
SPMCommand
.
set_mlab_paths
(
matlab_cmd
=
matlab_cmd
,
use_mcr
=
True
)
version
=
spm
.
SPMCommand
()
.
version
else
:
version
=
spm
.
Info
.
version
()
if
version
:
if
version
:
if
version
[
'name'
]
==
'SPM8'
:
if
isinstance
(
version
,
dict
):
print
'You are using SPM version 8. The recommended version to use with Clinica is SPM 12. '
\
spm_path
=
version
[
'path'
]
'Please upgrade your SPM toolbox.'
if
version
[
'name'
]
==
'SPM8'
:
elif
version
[
'name'
]
!=
'SPM12'
:
print
'You are using SPM version 8. The recommended version to use with Clinica is SPM 12. '
\
raise
RuntimeError
(
'SPM version 8 or 12 could not be found. Please upgrade your SPM toolbox.'
)
'Please upgrade your SPM toolbox.'
tissue_map
=
os
.
path
.
join
(
spm_path
,
'toolbox/Seg/TPM.nii'
)
elif
version
[
'name'
]
==
'SPM12'
:
tissue_map
=
os
.
path
.
join
(
spm_path
,
'tpm/TPM.nii'
)
else
:
raise
RuntimeError
(
'SPM version 8 or 12 could not be found. Please upgrade your SPM toolbox.'
)
if
isinstance
(
version
,
unicode
):
if
version
==
'12.7169'
:
tissue_map
=
os
.
path
.
join
(
unicode
(
spm_home
),
'spm12_mcr/spm/spm12/tpm/TPM.nii'
)
else
:
raise
RuntimeError
(
'SPM standalone version not supported. Please upgrade SPM standalone.'
)
else
:
else
:
raise
RuntimeError
(
'SPM could not be found. Please verify your SPM_HOME environment variable.'
)
raise
RuntimeError
(
'SPM could not be found. Please verify your SPM_HOME environment variable.'
)
# Unzipping
# Unzipping
# =========
# =========
unzip_tissues_node
=
npe
.
MapNode
(
nutil
.
Function
(
input_names
=
[
'in_file'
],
unzip_tissues_node
=
npe
.
MapNode
(
nutil
.
Function
(
input_names
=
[
'in_file'
],
...
...
clinica/pipelines/t1_volume_existing_template/t1_volume_existing_template_utils.py
View file @
fde9a5e7
...
@@ -21,6 +21,14 @@ __email__ = "jorge.samper-gonzalez@inria.fr"
...
@@ -21,6 +21,14 @@ __email__ = "jorge.samper-gonzalez@inria.fr"
__status__
=
"Development"
__status__
=
"Development"
if
'SPMSTANDALONE_HOME'
in
os
.
environ
:
if
'MCR_HOME'
in
os
.
environ
:
matlab_cmd
=
os
.
environ
[
'SPMSTANDALONE_HOME'
]
\
+
'/run_spm12.sh '
\
+
os
.
environ
[
'MCR_HOME'
]
\
+
' script'
SPMCommand
.
set_mlab_paths
(
matlab_cmd
=
matlab_cmd
,
use_mcr
=
True
)
class
DARTELExistingTemplateInputSpec
(
SPMCommandInputSpec
):
class
DARTELExistingTemplateInputSpec
(
SPMCommandInputSpec
):
image_files
=
traits
.
List
(
traits
.
List
(
File
(
exists
=
True
)),
image_files
=
traits
.
List
(
traits
.
List
(
File
(
exists
=
True
)),
desc
=
"A list of files to be segmented"
,
desc
=
"A list of files to be segmented"
,
...
...
clinica/pipelines/t1_volume_new_template/t1_volume_new_template_pipeline.py
View file @
fde9a5e7
...
@@ -321,22 +321,37 @@ class T1VolumeNewTemplate(cpe.Pipeline):
...
@@ -321,22 +321,37 @@ class T1VolumeNewTemplate(cpe.Pipeline):
mlab
.
MatlabCommand
.
set_default_matlab_cmd
(
mlab_home
)
mlab
.
MatlabCommand
.
set_default_matlab_cmd
(
mlab_home
)
mlab
.
MatlabCommand
.
set_default_paths
(
spm_home
)
mlab
.
MatlabCommand
.
set_default_paths
(
spm_home
)
version
=
spm
.
Info
.
version
()
if
'SPMSTANDALONE_HOME'
in
os
.
environ
:
#TODO: remove check for SPM
if
'MCR_HOME'
in
os
.
environ
:
matlab_cmd
=
os
.
path
.
join
(
os
.
environ
[
'SPMSTANDALONE_HOME'
],
'run_spm12.sh'
)
\
+
' '
+
os
.
environ
[
'MCR_HOME'
]
\
+
' script'
spm
.
SPMCommand
.
set_mlab_paths
(
matlab_cmd
=
matlab_cmd
,
use_mcr
=
True
)
version
=
spm
.
SPMCommand
()
.
version
else
:
version
=
spm
.
Info
.
version
()
if
version
:
if
version
:
spm_path
=
version
[
'path'
]
if
isinstance
(
version
,
dict
):
if
version
[
'name'
]
==
'SPM8'
:
spm_path
=
version
[
'path'
]
print
'You are using SPM version 8. The recommended version to use with Clinica is SPM 12. '
\
if
version
[
'name'
]
==
'SPM8'
:
'Please upgrade your SPM toolbox.'
print
'You are using SPM version 8. The recommended version to use with Clinica is SPM 12. '
\
tissue_map
=
op
.
join
(
spm_path
,
'toolbox/Seg/TPM.nii'
)
'Please upgrade your SPM toolbox.'
elif
version
[
'name'
]
==
'SPM12'
:
tissue_map
=
os
.
path
.
join
(
spm_path
,
'toolbox/Seg/TPM.nii'
)
tissue_map
=
op
.
join
(
spm_path
,
'tpm/TPM.nii'
)
elif
version
[
'name'
]
==
'SPM12'
:
else
:
tissue_map
=
os
.
path
.
join
(
spm_path
,
'tpm/TPM.nii'
)
raise
RuntimeError
(
'SPM version 8 or 12 could not be found. Please upgrade your SPM toolbox.'
)
else
:
raise
RuntimeError
(
'SPM version 8 or 12 could not be found. Please upgrade your SPM toolbox.'
)
if
isinstance
(
version
,
unicode
):
if
version
==
'12.7169'
:
tissue_map
=
os
.
path
.
join
(
unicode
(
spm_home
),
'spm12_mcr/spm/spm12/tpm/TPM.nii'
)
else
:
raise
RuntimeError
(
'SPM standalone version not supported. Please upgrade SPM standalone.'
)
else
:
else
:
raise
RuntimeError
(
'SPM could not be found. Please verify your SPM_HOME environment variable.'
)
raise
RuntimeError
(
'SPM could not be found. Please verify your SPM_HOME environment variable.'
)
# Unzipping
# Unzipping
# ===============================
# ===============================
unzip_node
=
npe
.
MapNode
(
nutil
.
Function
(
input_names
=
[
'in_file'
],
unzip_node
=
npe
.
MapNode
(
nutil
.
Function
(
input_names
=
[
'in_file'
],
...
...
clinica/pipelines/t1_volume_tissue_segmentation/t1_volume_tissue_segmentation_pipeline.py
View file @
fde9a5e7
...
@@ -201,21 +201,36 @@ class T1VolumeTissueSegmentation(cpe.Pipeline):
...
@@ -201,21 +201,36 @@ class T1VolumeTissueSegmentation(cpe.Pipeline):
mlab
.
MatlabCommand
.
set_default_matlab_cmd
(
mlab_home
)
mlab
.
MatlabCommand
.
set_default_matlab_cmd
(
mlab_home
)
mlab
.
MatlabCommand
.
set_default_paths
(
spm_home
)
mlab
.
MatlabCommand
.
set_default_paths
(
spm_home
)
version
=
spm
.
Info
.
version
()
if
'SPMSTANDALONE_HOME'
in
os
.
environ
:
if
'MCR_HOME'
in
os
.
environ
:
matlab_cmd
=
os
.
path
.
join
(
os
.
environ
[
'SPMSTANDALONE_HOME'
],
'run_spm12.sh'
)
\
+
' '
+
os
.
environ
[
'MCR_HOME'
]
\
+
' script'
spm
.
SPMCommand
.
set_mlab_paths
(
matlab_cmd
=
matlab_cmd
,
use_mcr
=
True
)
version
=
spm
.
SPMCommand
()
.
version
else
:
version
=
spm
.
Info
.
version
()
if
version
:
if
version
:
spm_path
=
version
[
'path'
]
if
isinstance
(
version
,
dict
):
if
version
[
'name'
]
==
'SPM8'
:
spm_path
=
version
[
'path'
]
print
'You are using SPM version 8. The recommended version to use with Clinica is SPM 12. '
\
if
version
[
'name'
]
==
'SPM8'
:
'Please upgrade your SPM toolbox.'
print
'You are using SPM version 8. The recommended version to use with Clinica is SPM 12. '
\
tissue_map
=
op
.
join
(
spm_path
,
'toolbox/Seg/TPM.nii'
)
'Please upgrade your SPM toolbox.'
elif
version
[
'name'
]
==
'SPM12'
:
tissue_map
=
os
.
path
.
join
(
spm_path
,
'toolbox/Seg/TPM.nii'
)
tissue_map
=
op
.
join
(
spm_path
,
'tpm/TPM.nii'
)
elif
version
[
'name'
]
==
'SPM12'
:
else
:
tissue_map
=
os
.
path
.
join
(
spm_path
,
'tpm/TPM.nii'
)
raise
RuntimeError
(
'SPM version 8 or 12 could not be found. Please upgrade your SPM toolbox.'
)
else
:
raise
RuntimeError
(
'SPM version 8 or 12 could not be found. Please upgrade your SPM toolbox.'
)
if
isinstance
(
version
,
unicode
):
if
version
==
'12.7169'
:
tissue_map
=
os
.
path
.
join
(
unicode
(
spm_home
),
'spm12_mcr/spm/spm12/tpm/TPM.nii'
)
else
:
raise
RuntimeError
(
'SPM standalone version not supported. Please upgrade SPM standalone.'
)
else
:
else
:
raise
RuntimeError
(
'SPM could not be found. Please verify your SPM_HOME environment variable.'
)
raise
RuntimeError
(
'SPM could not be found. Please verify your SPM_HOME environment variable.'
)
# Unzipping
# Unzipping
# ===============================
# ===============================
unzip_node
=
npe
.
MapNode
(
nutil
.
Function
(
input_names
=
[
'in_file'
],
unzip_node
=
npe
.
MapNode
(
nutil
.
Function
(
input_names
=
[
'in_file'
],
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment