Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 1b5793a

Browse files
Merge pull request #3602 from mnoergaard/update_petsurfer
ENH: Update PETsurfer interface
2 parents d2f4953 + 6b7bda4 commit 1b5793a

File tree

8 files changed

+97
-20
lines changed

8 files changed

+97
-20
lines changed

‎nipype/interfaces/freesurfer/model.py‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -420,6 +420,14 @@ class GLMFitInputSpec(FSTraitedSpec):
420420
argstr="--logan %s %s %f",
421421
desc="RefTac TimeSec tstar : perform Logan kinetic modeling",
422422
)
423+
bp_clip_neg = traits.Bool(
424+
argstr="--bp-clip-neg",
425+
desc="set negative BP voxels to zero",
426+
)
427+
bp_clip_max = traits.Float(
428+
argstr="--bp-clip-max %f",
429+
desc="set BP voxels above max to max",
430+
)
423431
force_perm = traits.Bool(
424432
argstr="--perm-force",
425433
desc="force perumtation test, even when design matrix is not orthog",

‎nipype/interfaces/freesurfer/petsurfer.py‎

Lines changed: 34 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -458,10 +458,25 @@ class GTMPVCOutputSpec(TraitedSpec):
458458
yhat_with_noise = File(
459459
desc="4D PET file with full FOV of signal estimate (yhat) with noise after PVC (smoothed with PSF)",
460460
)
461+
eres = File(
462+
desc="4D PET file of residual error after PVC (smoothed with PSF)",
463+
)
464+
tissue_fraction = File(
465+
desc="4D PET file of tissue fraction before PVC",
466+
)
467+
tissue_fraction_psf = File(
468+
desc="4D PET file of tissue fraction after PVC (smoothed with PSF)",
469+
)
470+
seg = File(
471+
desc="Segmentation file of regions used for PVC",
472+
)
473+
seg_ctab = File(
474+
desc="Color table file for segmentation file",
475+
)
461476

462477

463478
class GTMPVC(FSCommand):
464-
"""create an anatomical segmentation for the geometric transfer matrix (GTM).
479+
"""Perform Partial Volume Correction (PVC) to PET Data.
465480
466481
Examples
467482
--------
@@ -536,6 +551,15 @@ def _list_outputs(self):
536551
outputs["gtm_stats"] = os.path.join(pvcdir, "gtm.stats.dat")
537552
outputs["reg_pet2anat"] = os.path.join(pvcdir, "aux", "bbpet2anat.lta")
538553
outputs["reg_anat2pet"] = os.path.join(pvcdir, "aux", "anat2bbpet.lta")
554+
outputs["eres"] = os.path.join(pvcdir, "eres.nii.gz")
555+
outputs["tissue_fraction"] = os.path.join(
556+
pvcdir, "aux", "tissue.fraction.nii.gz"
557+
)
558+
outputs["tissue_fraction_psf"] = os.path.join(
559+
pvcdir, "aux", "tissue.fraction.psf.nii.gz"
560+
)
561+
outputs["seg"] = os.path.join(pvcdir, "aux", "seg.nii.gz")
562+
outputs["seg_ctab"] = os.path.join(pvcdir, "aux", "seg.ctab")
539563

540564
# Assign the conditional outputs
541565
if self.inputs.save_input:
@@ -562,7 +586,7 @@ def _list_outputs(self):
562586
return outputs
563587

564588

565-
class MRTMInputSpec(GLMFitInputSpec):
589+
class MRTM1InputSpec(GLMFitInputSpec):
566590
mrtm1 = traits.Tuple(
567591
File(exists=True),
568592
File(exists=True),
@@ -572,20 +596,20 @@ class MRTMInputSpec(GLMFitInputSpec):
572596
)
573597

574598

575-
class MRTM(GLMFit):
599+
class MRTM1(GLMFit):
576600
"""Perform MRTM1 kinetic modeling.
577601
578602
Examples
579603
--------
580-
>>> mrtm = MRTM()
604+
>>> mrtm = MRTM1()
581605
>>> mrtm.inputs.in_file = 'tac.nii'
582606
>>> mrtm.inputs.mrtm1 = ('ref_tac.dat', 'timing.dat')
583607
>>> mrtm.inputs.glm_dir = 'mrtm'
584608
>>> mrtm.cmdline
585609
'mri_glmfit --glmdir mrtm --y tac.nii --mrtm1 ref_tac.dat timing.dat'
586610
"""
587611

588-
input_spec = MRTMInputSpec
612+
input_spec = MRTM1InputSpec
589613

590614

591615
class MRTM2InputSpec(GLMFitInputSpec):
@@ -614,7 +638,7 @@ class MRTM2(GLMFit):
614638
input_spec = MRTM2InputSpec
615639

616640

617-
class LoganRefInputSpec(GLMFitInputSpec):
641+
class LoganInputSpec(GLMFitInputSpec):
618642
logan = traits.Tuple(
619643
File(exists=True),
620644
File(exists=True),
@@ -625,16 +649,16 @@ class LoganRefInputSpec(GLMFitInputSpec):
625649
)
626650

627651

628-
class LoganRef(GLMFit):
629-
"""Perform Logan reference kinetic modeling.
652+
class Logan(GLMFit):
653+
"""Perform Logan kinetic modeling.
630654
Examples
631655
--------
632-
>>> logan = LoganRef()
656+
>>> logan = Logan()
633657
>>> logan.inputs.in_file = 'tac.nii'
634658
>>> logan.inputs.logan = ('ref_tac.dat', 'timing.dat', 2600)
635659
>>> logan.inputs.glm_dir = 'logan'
636660
>>> logan.cmdline
637661
'mri_glmfit --glmdir logan --y tac.nii --logan ref_tac.dat timing.dat 2600'
638662
"""
639663

640-
input_spec = LoganRefInputSpec
664+
input_spec = LoganInputSpec

‎nipype/interfaces/freesurfer/tests/test_auto_GLMFit.py‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@ def test_GLMFit_inputs():
1313
args=dict(
1414
argstr="%s",
1515
),
16+
bp_clip_max=dict(
17+
argstr="--bp-clip-max %f",
18+
),
19+
bp_clip_neg=dict(
20+
argstr="--bp-clip-neg",
21+
),
1622
calc_AR1=dict(
1723
argstr="--tar1",
1824
),

‎nipype/interfaces/freesurfer/tests/test_auto_GTMPVC.py‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,9 @@ def test_GTMPVC_inputs():
207207

208208
def test_GTMPVC_outputs():
209209
output_map = dict(
210+
eres=dict(
211+
extensions=None,
212+
),
210213
gtm_file=dict(
211214
extensions=None,
212215
),
@@ -256,6 +259,18 @@ def test_GTMPVC_outputs():
256259
reg_rbvpet2anat=dict(
257260
extensions=None,
258261
),
262+
seg=dict(
263+
extensions=None,
264+
),
265+
seg_ctab=dict(
266+
extensions=None,
267+
),
268+
tissue_fraction=dict(
269+
extensions=None,
270+
),
271+
tissue_fraction_psf=dict(
272+
extensions=None,
273+
),
259274
yhat=dict(
260275
extensions=None,
261276
),

‎nipype/interfaces/freesurfer/tests/test_auto_LoganRef.py‎ renamed to ‎nipype/interfaces/freesurfer/tests/test_auto_Logan.py‎

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT
2-
from ..petsurfer import LoganRef
2+
from ..petsurfer import Logan
33

44

5-
def test_LoganRef_inputs():
5+
def test_Logan_inputs():
66
input_map = dict(
77
allow_ill_cond=dict(
88
argstr="--illcond",
@@ -13,6 +13,12 @@ def test_LoganRef_inputs():
1313
args=dict(
1414
argstr="%s",
1515
),
16+
bp_clip_max=dict(
17+
argstr="--bp-clip-max %f",
18+
),
19+
bp_clip_neg=dict(
20+
argstr="--bp-clip-neg",
21+
),
1622
calc_AR1=dict(
1723
argstr="--tar1",
1824
),
@@ -214,14 +220,14 @@ def test_LoganRef_inputs():
214220
xor=("weight_file", "weight_inv", "weight_sqrt"),
215221
),
216222
)
217-
inputs = LoganRef.input_spec()
223+
inputs = Logan.input_spec()
218224

219225
for key, metadata in list(input_map.items()):
220226
for metakey, value in list(metadata.items()):
221227
assert getattr(inputs.traits()[key], metakey) == value
222228

223229

224-
def test_LoganRef_outputs():
230+
def test_Logan_outputs():
225231
output_map = dict(
226232
beta_file=dict(
227233
extensions=None,
@@ -271,7 +277,7 @@ def test_LoganRef_outputs():
271277
extensions=None,
272278
),
273279
)
274-
outputs = LoganRef.output_spec()
280+
outputs = Logan.output_spec()
275281

276282
for key, metadata in list(output_map.items()):
277283
for metakey, value in list(metadata.items()):

‎nipype/interfaces/freesurfer/tests/test_auto_MRTM.py‎ renamed to ‎nipype/interfaces/freesurfer/tests/test_auto_MRTM1.py‎

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT
2-
from ..petsurfer import MRTM
2+
from ..petsurfer import MRTM1
33

44

5-
def test_MRTM_inputs():
5+
def test_MRTM1_inputs():
66
input_map = dict(
77
allow_ill_cond=dict(
88
argstr="--illcond",
@@ -13,6 +13,12 @@ def test_MRTM_inputs():
1313
args=dict(
1414
argstr="%s",
1515
),
16+
bp_clip_max=dict(
17+
argstr="--bp-clip-max %f",
18+
),
19+
bp_clip_neg=dict(
20+
argstr="--bp-clip-neg",
21+
),
1622
calc_AR1=dict(
1723
argstr="--tar1",
1824
),
@@ -214,14 +220,14 @@ def test_MRTM_inputs():
214220
xor=("weight_file", "weight_inv", "weight_sqrt"),
215221
),
216222
)
217-
inputs = MRTM.input_spec()
223+
inputs = MRTM1.input_spec()
218224

219225
for key, metadata in list(input_map.items()):
220226
for metakey, value in list(metadata.items()):
221227
assert getattr(inputs.traits()[key], metakey) == value
222228

223229

224-
def test_MRTM_outputs():
230+
def test_MRTM1_outputs():
225231
output_map = dict(
226232
beta_file=dict(
227233
extensions=None,
@@ -271,7 +277,7 @@ def test_MRTM_outputs():
271277
extensions=None,
272278
),
273279
)
274-
outputs = MRTM.output_spec()
280+
outputs = MRTM1.output_spec()
275281

276282
for key, metadata in list(output_map.items()):
277283
for metakey, value in list(metadata.items()):

‎nipype/interfaces/freesurfer/tests/test_auto_MRTM2.py‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@ def test_MRTM2_inputs():
1313
args=dict(
1414
argstr="%s",
1515
),
16+
bp_clip_max=dict(
17+
argstr="--bp-clip-max %f",
18+
),
19+
bp_clip_neg=dict(
20+
argstr="--bp-clip-neg",
21+
),
1622
calc_AR1=dict(
1723
argstr="--tar1",
1824
),

‎nipype/interfaces/freesurfer/tests/test_auto_OneSampleTTest.py‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@ def test_OneSampleTTest_inputs():
1313
args=dict(
1414
argstr="%s",
1515
),
16+
bp_clip_max=dict(
17+
argstr="--bp-clip-max %f",
18+
),
19+
bp_clip_neg=dict(
20+
argstr="--bp-clip-neg",
21+
),
1622
calc_AR1=dict(
1723
argstr="--tar1",
1824
),

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /