Main Content

imref3d

Reference 3-D image to world coordinates

Description

An imref3d object stores 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, -y and -z values align with world-x, -y, and -z values, respectively. The resolution in each dimension can be different.

Creation

You can create an imref3d object in these ways.

  • affineOutputView — Store the spatial extent of an image that is warped by a 3-D affine geometric transformation.

  • The imref3d function described here

Description

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

R = imref3d(imageSize) sets the optional ImageSize property.

example

R = imref3d(imageSize,pixelExtentInWorldX,pixelExtentInWorldY,pixelExtentInWorldZ) sets the optional ImageSize, PixelExtentInWorldX, PixelExtentInWorldY, and PixelExtentInWorldZ properties.

R = imref3d(imageSize,xWorldLimits,yWorldLimits,zWorldLimits) sets the optional ImageSize, XWorldLimits, YWorldLimits, and ZWorldLimits properties.

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 3-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 number.

Data Types: double

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

Data Types: double

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

Data Types: double

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

Data Types: double

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

Data Types: double

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

Data Types: double

Limits of image in intrinsic units in the x-dimension, specified as a 2-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 2-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 2-element row vector [zMin zMax]. For an m-by-n-by-p image, it equals [0.5, p+0.5].

Data Types: double

Object Functions

containsDetermine if image contains points in world coordinate system
intrinsicToWorldConvert from intrinsic to world coordinates
sizesMatchDetermine if object and image are size-compatible
worldToIntrinsicConvert from world to intrinsic coordinates
worldToSubscriptConvert world coordinates to row and column subscripts

Examples

collapse 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

More About

expand all

Extended Capabilities

Version History

Introduced in R2013a