newMriImageFromFile(tractor.base)
newMriImageFromFile()所属R语言包:tractor.base
Working with MRI images stored in NIfTI, Analyze and MGH formats
工作与MRI图像存储在NIfTI,分析和麻省总医院的格式
译者:生物统计家园网 机器人LoveR
描述----------Description----------
Functions for reading, writing, locating, copying and removing MRI images stored in NIfTI, Analyze and MGH formats.
读,写,查找,复制和删除存储在NIfTI的MRI图像的功能,分析和,MGH格式。
用法----------Usage----------
newMriImageFromFile(fileName, fileType = NULL, volumes = NULL, sparse = FALSE, mask = NULL)
newMriImageMetadataFromFile(fileName, fileType = NULL)
writeMriImageToFile(image, fileName = NULL, fileType = NA, datatype = NULL, overwrite = TRUE)
identifyImageFileNames(fileName, fileType = NULL, errorIfMissing = TRUE)
imageFileExists(fileName, fileType = NULL)
removeImageFilesWithName(fileName)
copyImageFiles(from, to, overwrite = FALSE, deleteOriginals = FALSE)
symlinkImageFiles(from, to, overwrite = FALSE, relative = TRUE)
参数----------Arguments----------
参数:fileName, from, to
File names, with or without appropriate extension.
文件名,或没有适当延长。
参数:image
An MriImage object.
MriImage对象。
参数:fileType
A character vector of length one, giving the file type required or expected. If this option is missing, the file type used for writing images will be taken from the tractorFileType option. See Details.
字符向量的长度为1,要求或预期的文件类型。如果缺少此选项,用于影像写入的文件类型,将采取从tractorFileType选项。查看详细信息。
参数:volumes
An optional integer vector specifying a subset of volumes to read (generally to save memory). If given, only the requested volumes in the 4D file will be read.
指定一个可选的整数向量的一个子集卷阅读(一般以节省内存)。如果给定的,只有被请求的卷在四维文件也会被读取。
参数:sparse
Logical value: should the image data be stored in a SparseArray object?
逻辑值的图像数据存储在一个SparseArray对象?
参数:mask
An optional MriImage object representing a mask, outside of which the image to be read should be considered to be zero. This can be used to save memory when only a small part of a large image is of interest. Ignored if sparse is not TRUE.
一个可选的MriImage的对象代表掩模,其中外面以被读取的图像,应被视为是零。这可以用来节省存储空间时,只有一小部分是利益的一个大的图像。如果sparse不TRUE忽略。
参数:datatype
A storage data type. See getDataTypeByNiftiCode.
一个存储的数据类型。见getDataTypeByNiftiCode。
参数:overwrite
Logical value: overwrite an existing image file? For writeMriImageToFile, an error will be raised if there is an existing file and this is set to FALSE.
逻辑值:覆盖现有的图像文件? writeMriImageToFile,错误将提出,如果有一个现有的文件,并设置为FALSE。
参数:errorIfMissing
Logical value: raise an error if no suitable files were found?
逻辑值:提出一个错误,如果没有合适的文件被发现?
参数:deleteOriginals
Logical value: if TRUE, copyImageFiles performs a move rather than a copy.
逻辑值:如果TRUE,copyImageFiles执行移动,而不是复制。
参数:relative
Logical value: if TRUE, the path stored in the symlink will be relative (e.g. "../some_dir/some_image.nii") rather than absolute (e.g. "/path/to/some_dir/some_image.nii").
逻辑值:如果TRUE,存储的符号链接是相对的路径(例如"../some_dir/some_image.nii")而不是绝对的(如:"/path/to/some_dir/some_image.nii")。
Details
详细信息----------Details----------
NIfTI and Analyze are related formats for storing magnetic resonance images. NIfTI is a more recent extension of Analyze, and contains more specific information about, for example, the orientation of the image. Its use is therefore recommended where possible. MGH format is used by the popular image processing package FreeSurfer. These formats use a number of different file extensions, but the details are abstracted away from the user by these functions.
NIfTI和分析相关的格式,用于存储磁共振图像。 NIfTI是最近的一个延长的分析,并包含更具体的信息,例如,图像的取向。因此,建议在可能的情况下它的使用。 MGH格式流行的图像处理包FreeSurfer的使用。这些格式使用了一些不同的文件扩展名,但在细节中抽象出来,用户通过这些功能。
TractoR does not allow for files with the same basic name using multiple Analyze/NIfTI/MGH formats in a single directory (e.g. "foo.nii" AND "foo.img"), and these functions will produce an error if multiple compatible files exist.
拖拉机不会允许一个单独的目录(例如"foo.nii"和"foo.img")在使用多个分析/ NIfTI / MGH格式的文件具有相同的基本名称,如果存在多个兼容的文件,这些功能会产生一个错误。
Suitable values for fileType (and the tractorFileType option, which is used as a default) are ANALYZE, NIFTI, NIFTI_PAIR (the two-file NIfTI format), MGH, ANALYZE_GZ, NIFTI_GZ, NIFTI_PAIR_GZ and MGH_GZ. The latter four are gzipped versions of the former four. NIFTI_GZ is recommended unless there is a need for one of the others. This is the default value for the tractorFileType option, but that can be changed using a call to options, or by setting the TRACTOR_FILETYPE environment variable before loading the tractor.base package.
合适fileType(tractorFileType选项,它被用作一个默认)ANALYZE,NIFTI,NIFTI_PAIR(两个文件NIfTI格式的值),MGH,ANALYZE_GZ,NIFTI_GZ,NIFTI_PAIR_GZ和MGH_GZ。后四个是前四的gzip压缩的版本。 NIFTI_GZ建议,除非有一个需要其他之一。这是为tractorFileType选项的默认值,但可以改变的使用的调用options,或通过设置TRACTOR_FILETYPE环境变量,然后再加载tractor.base包。
Since multiple files may be involved, copying, moving or symlinking images is not trivial. copyImageFiles and symlinkImageFiles are wrappers around the standard functions file.copy and file.symlink which handle this complexity.
由于可能涉及多个文件的复制,移动或libg.a连结图像是不平凡的。 copyImageFiles和symlinkImageFiles是包装器的标准功能file.copy和file.symlink处理这种复杂性。
值----------Value----------
newMriImageFromFile and newMriImageMetadataFromFile return the appropriate image or metadata object. imageFileExists returns TRUE if an existing file with the specified name exists (all file extensions are checked), and FALSE otherwise. removeImageFilesWithName returns the result of unlink applied to all relevant files. writeMriImageToFile and identifyImageFileNames return a list with the following elements, describing the identified or written files:
newMriImageFromFile和newMriImageMetadataFromFile返回相应的图像或元数据对象。 imageFileExists回报TRUE,如果存在指定名称(检查所有文件扩展名),FALSE否则现有的文件。 removeImageFilesWithName返回结果的unlink适用于所有相关文件。 writeMriImageToFile和identifyImageFileNames返回一个列表,包含下列元素的,描述的确定或书面的文件:
参数:fileStem
The file name without extension.
不带扩展名的文件名。
参数:headerFile
The full header file name.
完整的头文件名。
参数:imageFile
The full image file name.
完整的图像文件名。
参数:format
The format of the files ("Nifti", "Analyze" or "Mgh"). Not returned by writeMriImageToFile.
格式的文件中("Nifti","Analyze"或"Mgh")。不返回writeMriImageToFile。
copyImageFiles and symlinkImageFiles are called for their side effects.
copyImageFiles和symlinkImageFiles被称为其副作用。
(作者)----------Author(s)----------
Jon Clayden
参考文献----------References----------
参见----------See Also----------
The NIfTI-1 standard (http://nifti.nimh.nih.gov/nifti-1); MriImage, MriImageMetadata, getDataTypeByNiftiCode and unlink.
NIfTI-1的标准(http://nifti.nimh.nih.gov/nifti-1);MriImage,MriImageMetadata,getDataTypeByNiftiCode和unlink。
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|