nipype.interfaces.dcmstack module¶
dcmstack allows series of DICOM images to be stacked into multi-dimensional arrays.
CopyMeta¶
Bases: BaseInterface
Copy meta data from one Nifti file to another. Useful for preserving meta data after some processing steps.
dest_file : a pathlike object or string representing an existing file src_file : a pathlike object or string representing an existing file
- exclude_classesa list of items which are any value
List of meta data classifications to exclude.
- include_classesa list of items which are any value
List of specific meta data classifications to include. If not specified include everything.
dest_file : a pathlike object or string representing an existing file
DcmStack¶
Bases: NiftiGeneratorBase
Create one Nifti file from a set of DICOM files. Can optionally embed meta data.
Example
>>> from nipype.interfaces.dcmstack import DcmStack >>> stacker = DcmStack() >>> stacker.inputs.dicom_files = 'path/to/series/' >>> stacker.run() >>> result.outputs.out_file '/path/to/cwd/sequence.nii.gz'dicom_files : a list of items which are a pathlike object or string representing an existing file or a pathlike object or string representing an existing directory or a string
- embed_metaa boolean
Embed DICOM meta data into result.
- exclude_regexesa list of items which are any value
Meta data to exclude, suplementing any default exclude filters.
- force_reada boolean
Force reading files without DICM marker. (Nipype default value:
True
)- include_regexesa list of items which are any value
Meta data to include, overriding any exclude filters.
- out_exta string
Determines output file type. (Nipype default value:
.nii.gz
)- out_formata string
String which can be formatted with meta data to create the output filename(s).
- out_patha pathlike object or string representing a directory
Output path, current working directory if not set.
out_file : a pathlike object or string representing an existing file
GroupAndStack¶
Bases: DcmStack
Create (potentially) multiple Nifti files for a set of DICOM files.
dicom_files : a list of items which are a pathlike object or string representing an existing file or a pathlike object or string representing an existing directory or a string
- embed_metaa boolean
Embed DICOM meta data into result.
- exclude_regexesa list of items which are any value
Meta data to exclude, suplementing any default exclude filters.
- force_reada boolean
Force reading files without DICM marker. (Nipype default value:
True
)- include_regexesa list of items which are any value
Meta data to include, overriding any exclude filters.
- out_exta string
Determines output file type. (Nipype default value:
.nii.gz
)- out_formata string
String which can be formatted with meta data to create the output filename(s).
- out_patha pathlike object or string representing a directory
Output path, current working directory if not set.
- out_lista list of items which are any value
List of output nifti files.
LookupMeta¶
Bases: BaseInterface
Lookup meta data values from a Nifti with embedded meta data.
Example
>>> from nipype.interfaces import dcmstack >>> lookup = dcmstack.LookupMeta() >>> lookup.inputs.in_file = 'functional.nii' >>> lookup.inputs.meta_keys = {'RepetitionTime' : 'TR', 'EchoTime' : 'TE'} >>> result = lookup.run() >>> result.outputs.TR 9500.0 >>> result.outputs.TE 95.0
- in_filea pathlike object or string representing an existing file
The input Nifti file.
- meta_keysa list of items which are any value or a dictionary with keys which are any value and with values which are any value
List of meta data keys to lookup, or a dict where keys specify the meta data keys to lookup and the values specify the output names.
- LookupMeta.output_spec¶
alias of
DynamicTraitedSpec
MergeNifti¶
Bases: NiftiGeneratorBase
Merge multiple Nifti files into one. Merges together meta data extensions as well.
- in_filesa list of items which are any value
List of Nifti files to merge.
- merge_diman integer
Dimension to merge along. If not specified, the last singular or non-existent dimension is used.
- out_exta string
Determines output file type. (Nipype default value:
.nii.gz
)- out_formata string
String which can be formatted with meta data to create the output filename(s).
- out_patha pathlike object or string representing a directory
Output path, current working directory if not set.
- sort_ordera string or a list of items which are any value
One or more meta data keys to sort files by.
- out_filea pathlike object or string representing an existing file
Merged Nifti file.
NiftiGeneratorBase¶
Bases: BaseInterface
Base class for interfaces that produce Nifti files, potentially with embedded meta data.
SplitNifti¶
Bases: NiftiGeneratorBase
Split one Nifti file into many along the specified dimension. Each result has an updated meta data extension as well.
- in_filea pathlike object or string representing an existing file
Nifti file to split.
- out_exta string
Determines output file type. (Nipype default value:
.nii.gz
)- out_formata string
String which can be formatted with meta data to create the output filename(s).
- out_patha pathlike object or string representing a directory
Output path, current working directory if not set.
- split_diman integer
Dimension to split along. If not specified, the last dimension is used.
- out_lista list of items which are a pathlike object or string representing an existing file
Split Nifti files.
- nipype.interfaces.dcmstack.make_key_func(meta_keys, index=None)¶
- nipype.interfaces.dcmstack.sanitize_path_comp(path_comp)¶