Documentation

This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

imref3d class

Reference 3-D image to world coordinates

Description

An imref3d object encapsulates the relationship between the intrinsic coordinates anchored to the columns, rows, and planes of a 3-D image and the spatial location of the same column, row, and plane locations in a world coordinate system. The image is sampled regularly in the planar world-x, world-y, and world-z coordinates of the coordinate system such that intrinsic-x values align with world-x values, intrinsic-y values align with world-y values, and intrinsic-z values align with world-z values. The pixel spacing in each dimension may be different.

The intrinsic coordinate values (x,y,z) of the center point of any pixel are identical to the values of the column, row, and plane subscripts for that pixel. For example, the center point of the pixel in row 5, column 3, plane 4 has intrinsic coordinates x = 3.0, y = 5.0, z = 4.0. Be aware, however, that the order of the coordinate specification (3.0,5.0,4.0) is reversed in intrinsic coordinates relative to pixel subscripts (5,3,4). Intrinsic coordinates are defined on a continuous plane while the subscript locations are discrete locations with integer values.

Construction

R = imref3d() creates an imref3d object with default property settings.

R = imref3d(imageSize) creates an imref3d object given an image size. This syntax constructs a spatial referencing object for the default case in which the world coordinate system is co-aligned with the intrinsic coordinate system.

R = imref3d(imageSize,pixelExtentInWorldX,pixelExtentInWorldY,pixelExtentInWorldZ) creates an imref3d object given an image size and the resolution in each dimension, specified by pixelExtentInWorldX, pixelExtentInWorldY, and pixelExtentInWorldZ.

R = imref3d(imageSize,xWorldLimits,yWorldLimits,zWorldLimits) creates an imref3d object given an image size and the world limits in each dimension, specified by xWorldLimits, yWorldLimits and zWorldLimits.

Input Arguments

expand all

Size of the image associated with the object, specified as a three-element positive row vector. You can use the vector returned by the size function.

Example: imageSize = [128 128 27];

Data Types: double | single | uint8 | uint16 | uint32 | int8 | int16 | int32

Size of a single pixel in the x-dimension measured in the world coordinate system, specified as a positive scalar.

Data Types: double | single

Size of a single pixel in the y-dimension measured in the world coordinate system, specified as a positive scalar.

Data Types: double | single

Size of a single pixel in the z-dimension measured in the world coordinate system, specified as a positive scalar.

Data Types: double | single

Minimum and maximum coordinate values in the x-dimension in the world coordinate system, specified as a two-element numeric row vector.

Example: xWorldLimits = [0.5 256.5];

Data Types: double | single

Minimum and maximum coordinate values in the y-dimension in the world coordinate system, specified as a two-element numeric row vector.

Example: yWorldLimits = [0.5 256.5];

Data Types: double | single

Minimum and maximum coordinate values in the z-dimension in the world coordinate system, specified as a two-element numeric row vector.

Example: zWorldLimits = [0.5 27.5];

Data Types: double | single

Properties

expand all

Span of image in the x-dimension in the world coordinate system, specified as a numeric scalar. The imref3d object calculates this value as PixelExtentInX * ImageSize(2).

Data Types: double

Span of image in the y-dimension in the world coordinate system, specified as a numeric scalar. The imref3d object calculates this value as PixelExtentInY * ImageSize(1).

Data Types: double

Span of image in the z-dimension in the world coordinate system, specified as a numeric scalar. The imref3d object calculates this value as PixelExtentInZ * ImageSize(3).

Data Types: double

Number of elements in each spatial dimension, specified as a three-element positive row vector. ImageSize is the same form as that returned by the size function.

Data Types: double

Size of a single pixel in the x-dimension measured in the world coordinate system, specified as a positive scalar.

Data Types: double

Size of a single pixel in the y-dimension measured in the world coordinate system, specified as a positive scalar.

Data Types: double

Size of a single pixel in the z-dimension measured in the world coordinate system, specified as a positive scalar.

Data Types: double

Limits of image in world x, specified as a two-element row vector, [xMin xMax].

Data Types: double

Limits of image in world y, specified as a two-element row vector, [yMin yMax].

Data Types: double

Limits of image in world z, specified as a two-element row vector, [zMin zMax].

Data Types: double

Limits of image in intrinsic units in the x-dimension, specified as a two-element row vector [xMin xMax]. For an m-by-n-by-p image, it equals [0.5, n + 0.5].

Data Types: double

Limits of image in intrinsic units in the y-dimension, specified as a two-element row vector [yMin yMax]. For an m-by-n-by-p image, it equals [0.5, m + 0.5].

Data Types: double

Limits of image in intrinsic units in the z-dimension, specified as a two-element row vector [zMin zMax]. For an m-by-n-by-p image, it equals [0.5, p + 0.5].

Data Types: double

Methods

contains True if image contains points in world coordinate system
intrinsicToWorld Convert from intrinsic to world coordinates
sizesMatchTrue if object and image are size-compatible
worldToIntrinsicConvert from world to intrinsic coordinates
worldToSubscript World coordinates to row and column subscripts

Copy Semantics

Value. To learn how value classes affect copy operations, see Copying Objects (MATLAB) in the MATLAB® documentation.

Examples

expand all

Read image.

m = analyze75info('brainMRI.hdr');
A = analyze75read(m);

Create an imref3d object associated with the image, specifying the size of the pixels. The PixelDimensions field of the metadata of the file specifies the resolution in each dimension in millimeters/pixel.

RA = imref3d(size(A),m.PixelDimensions(2),m.PixelDimensions(1),m.PixelDimensions(3));
RA = 

  imref3d with properties:

           XWorldLimits: [0.5000 128.5000]
           YWorldLimits: [0.5000 128.5000]
           ZWorldLimits: [0.5000 27.5000]
              ImageSize: [128 128 27]
    PixelExtentInWorldX: 1
    PixelExtentInWorldY: 1
    PixelExtentInWorldZ: 1
    ImageExtentInWorldX: 128
    ImageExtentInWorldY: 128
    ImageExtentInWorldZ: 27
       XIntrinsicLimits: [0.5000 128.5000]
       YIntrinsicLimits: [0.5000 128.5000]
       ZIntrinsicLimits: [0.5000 27.5000]

Examine the extent of the image in each dimension in millimeters.

RA.ImageExtentInWorldX
RA.ImageExtentInWorldY
RA.ImageExtentInWorldZ
ans =

   128

ans =

   128

ans =

    27

Extended Capabilities

See Also

Was this topic helpful?