-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
176 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
|
||
[tool.poetry] | ||
name = "kepost" | ||
version = "0.2.10" | ||
version = "0.2.14" | ||
description = "Post-processing for dMRI derivatives of the Strauss Neuroplasticity Brain Bank (SNBB)" | ||
readme = "README.rst" | ||
authors = ["Gal Kepler <[email protected]>"] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,4 +2,4 @@ | |
|
||
__author__ = """Gal Kepler""" | ||
__email__ = "[email protected]" | ||
__version__ = "0.2.10" | ||
__version__ = "0.2.14" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
146 changes: 146 additions & 0 deletions
146
src/kepost/workflows/anatomical/procedures/generate_gm.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,146 @@ | ||
from nipype.interfaces import utility as niu | ||
from nipype.interfaces.fsl import ExtractROI, ImageMaths | ||
from nipype.pipeline import engine as pe | ||
from niworkflows.engine.workflows import LiterateWorkflow as Workflow | ||
|
||
from kepost.interfaces.mrtrix3 import MRConvert | ||
|
||
|
||
def init_gm_from_5tt_wf(name: str = "gm_from_5tt"): | ||
""" | ||
Initialize the gm from 5tt workflow. | ||
Parameters | ||
---------- | ||
name : str, optional | ||
The name of the workflow, by default "gm_from_5tt" | ||
Returns | ||
------- | ||
workflow : nipype.pipeline.engine.Workflow | ||
The gm from 5tt workflow. | ||
""" | ||
workflow = Workflow(name=name) | ||
inputnode = pe.Node( | ||
interface=niu.IdentityInterface( | ||
fields=[ | ||
"five_tissue_type", | ||
] | ||
), | ||
name="inputnode", | ||
) | ||
outputnode = pe.Node( | ||
interface=niu.IdentityInterface( | ||
fields=[ | ||
"gm_mask", | ||
] | ||
), | ||
name="outputnode", | ||
) | ||
mrconvert = pe.Node( | ||
interface=MRConvert( | ||
out_file="five_tissue_type.nii.gz", | ||
), | ||
name="mrconvert", | ||
) | ||
fslroi_cortical_gm = pe.Node( | ||
interface=ExtractROI( | ||
t_min=0, | ||
t_size=1, | ||
), | ||
name="fslroi_cortical_gm", | ||
) | ||
fslroi_subcortical_gm = pe.Node( | ||
interface=ExtractROI( | ||
t_min=1, | ||
t_size=1, | ||
), | ||
name="fslroi_subcortical_gm", | ||
) | ||
fslroi_pathological_gm = pe.Node( | ||
interface=ExtractROI( | ||
t_min=4, | ||
t_size=1, | ||
), | ||
name="fslroi_pathological_gm", | ||
) | ||
fslmaths_cortical_subcortical = pe.Node( | ||
interface=ImageMaths( | ||
op_string="-add", | ||
), | ||
name="fslmaths_cortical_subcortical", | ||
) | ||
fslmaths_cortical_subcortical_pathological = pe.Node( | ||
interface=ImageMaths( | ||
op_string="-add", | ||
), | ||
name="fslmaths_cortical_subcortical_pathological", | ||
) | ||
workflow.connect( | ||
[ | ||
( | ||
inputnode, | ||
mrconvert, | ||
[ | ||
("five_tissue_type", "in_file"), | ||
], | ||
), | ||
( | ||
mrconvert, | ||
fslroi_cortical_gm, | ||
[ | ||
("out_file", "in_file"), | ||
], | ||
), | ||
( | ||
mrconvert, | ||
fslroi_subcortical_gm, | ||
[ | ||
("out_file", "in_file"), | ||
], | ||
), | ||
( | ||
mrconvert, | ||
fslroi_pathological_gm, | ||
[ | ||
("out_file", "in_file"), | ||
], | ||
), | ||
( | ||
fslroi_cortical_gm, | ||
fslmaths_cortical_subcortical, | ||
[ | ||
("roi_file", "in_file"), | ||
], | ||
), | ||
( | ||
fslroi_subcortical_gm, | ||
fslmaths_cortical_subcortical, | ||
[ | ||
("roi_file", "in_file2"), | ||
], | ||
), | ||
( | ||
fslroi_pathological_gm, | ||
fslmaths_cortical_subcortical_pathological, | ||
[ | ||
("roi_file", "in_file"), | ||
], | ||
), | ||
( | ||
fslmaths_cortical_subcortical, | ||
fslmaths_cortical_subcortical_pathological, | ||
[ | ||
("out_file", "in_file2"), | ||
], | ||
), | ||
( | ||
fslmaths_cortical_subcortical_pathological, | ||
outputnode, | ||
[ | ||
("out_file", "gm_mask"), | ||
], | ||
), | ||
] | ||
) | ||
return workflow |
Binary file added
BIN
+4.46 MB
work/20241114-143932_600de297-34cc-4bd7-a51f-1aabb786f9b6/bids_db/keprep/layout_index.sqlite
Binary file not shown.
Binary file added
BIN
+72 KB
work/20241114-143932_600de297-34cc-4bd7-a51f-1aabb786f9b6/bids_db/layout_index.sqlite
Binary file not shown.