/
brainsresize.py
72 lines (56 loc) · 2.16 KB
/
brainsresize.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# -*- coding: utf-8 -*-
# -*- coding: utf8 -*-
"""Autogenerated file - DO NOT EDIT
If you spot a bug, please report it on the mailing list and/or change the generator."""
import os
from ...base import (
CommandLine,
CommandLineInputSpec,
SEMLikeCommandLine,
TraitedSpec,
File,
Directory,
traits,
isdefined,
InputMultiPath,
OutputMultiPath,
)
class BRAINSResizeInputSpec(CommandLineInputSpec):
inputVolume = File(desc="Image To Scale", exists=True, argstr="--inputVolume %s")
outputVolume = traits.Either(
traits.Bool,
File(),
hash_files=False,
desc="Resulting scaled image",
argstr="--outputVolume %s",
)
pixelType = traits.Enum(
"float",
"short",
"ushort",
"int",
"uint",
"uchar",
"binary",
desc="Specifies the pixel type for the input/output images. The 'binary' pixel type uses a modified algorithm whereby the image is read in as unsigned char, a signed distance map is created, signed distance map is resampled, and then a thresholded image of type unsigned char is written to disk.",
argstr="--pixelType %s",
)
scaleFactor = traits.Float(
desc="The scale factor for the image spacing.", argstr="--scaleFactor %f"
)
class BRAINSResizeOutputSpec(TraitedSpec):
outputVolume = File(desc="Resulting scaled image", exists=True)
class BRAINSResize(SEMLikeCommandLine):
"""title: Resize Image (BRAINS)
category: Registration
description: This program is useful for downsampling an image by a constant scale factor.
version: 3.0.0
license: https://www.nitrc.org/svn/brains/BuildScripts/trunk/License.txt
contributor: This tool was developed by Hans Johnson.
acknowledgements: The development of this tool was supported by funding from grants NS050568 and NS40068 from the National Institute of Neurological Disorders and Stroke and grants MH31593, MH40856, from the National Institute of Mental Health.
"""
input_spec = BRAINSResizeInputSpec
output_spec = BRAINSResizeOutputSpec
_cmd = " BRAINSResize "
_outputs_filenames = {"outputVolume": "outputVolume.nii"}
_redirect_x = False