nrrdinfo
Description
Examples
Read the metadata from an NRRD format file. The file is part of a data set containing the 3-D CT and MRI scans from The Retrospective Image Registration Evaluation (RIRE) Dataset, converted to the NRRD file format. The original data set was provided by Dr. Michael Fitzpatrick. For more information, see the RIRE Project homepage. The size of the entire data set is approximately 35 MB. Download the data set from the MathWorks® website, then unzip the folder.
zipFile = matlab.internal.examples.downloadSupportFile("medical", ... "MedicalRegistrationNRRDdata.zip"); filepath = fileparts(zipFile); unzip(zipFile,filepath)
Specify the name of the NRRD file to read.
filename = fullfile(filepath,"supportfilesNRRD","Patient007CT.nrrd");
Read the metadata from filename.
info = nrrdinfo(filename);
The ImageSize metadata field contains the image volume size, in pixels.
info.ImageSize
ans = 1×3
512 512 28
The PixelDimensions metadata field contains the voxel size in each dimension, in real world units such as millimeters.
info.PixelDimensions
ans = 1×3
0.6536 0.6536 4.0000
The SpatialMapping metadata field contains an affinetform3d object that defines the transformation between the intrinsic and patient coordinate systems for the volume.
info.SpatialMapping
ans =
affinetform3d with properties:
Dimensionality: 3
A: [4×4 double]
The RawAttributes metadata field contains the raw metadata extracted from the NRRD header information.
info.RawAttributes
ans = struct with fields:
dimension: '3'
sizes: '512 512 28 '
type: 'float'
encoding: 'raw'
endian: 'little'
spacedimension: '3'
spaceorigin: '(1.653595, 1.653595, 5.000000)'
spacedirections: '(0.653595,0.000000,0.000000) (0.000000,0.653595,0.000000) (0.000000,0.000000,4.000000)'
Input Arguments
Name of the NRRD file, specified as a string scalar or a character vector. The file
must contain a valid NRRD file header. The nrrdinfo function
supports NRRD files containing header and image data (.nrrd) as well
as detached header files (.nhdr). Specify
filenameas the absolute path to the file, a relative path from
the current directory, or a relative path from a directory on the MATLAB® path.
Data Types: char | string
Output Arguments
NRRD metadata, returned as a structure.
Version History
Introduced in R2022b
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Web サイトの選択
Web サイトを選択すると、翻訳されたコンテンツにアクセスし、地域のイベントやサービスを確認できます。現在の位置情報に基づき、次のサイトの選択を推奨します:
また、以下のリストから Web サイトを選択することもできます。
最適なサイトパフォーマンスの取得方法
中国のサイト (中国語または英語) を選択することで、最適なサイトパフォーマンスが得られます。その他の国の MathWorks のサイトは、お客様の地域からのアクセスが最適化されていません。
南北アメリカ
- América Latina (Español)
- Canada (English)
- United States (English)
ヨーロッパ
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)