Package com.pixelmed.dicom

# Class PixelSpacing

java.lang.Object
com.pixelmed.dicom.PixelSpacing

public class PixelSpacing extends Object

An class to extract and describe pixel spacing related information.

Currently only supports square pixels.

## Field Summary

Fields
Modifier and Type
Field
Description
`protected String`
`description`
`protected double`
`spacing`

## Constructor Summary

Constructors
Constructor
Description
`PixelSpacing(AttributeList list)`
Extract the appropriate spacing to use for measurements on projection radiographs or non-enhanced family cross-sectional images.
`PixelSpacing(AttributeList list, GeometryOfVolume volumeGeometry)`
Extract the appropriate spacing to use for measurements.
`PixelSpacing(AttributeList list, GeometryOfVolume volumeGeometry, boolean preferCalibratedValue, boolean useMagnificationFactorIfPresent)`
Extract the appropriate spacing to use for measurements.

## Method Summary

Modifier and Type
Method
Description
`String`
`getDescription()`
Get the description.
`double`
`getSpacing()`
Get the spacing.
`String`
`toString()`
Get the spacing and the description as a String.

### Methods inherited from class java.lang.Object

`clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait`

## Field Details

### spacing

protected double spacing

### description

protected String description

## Constructor Details

### PixelSpacing

public PixelSpacing(AttributeList list, GeometryOfVolume volumeGeometry, boolean preferCalibratedValue, boolean useMagnificationFactorIfPresent)

Extract the appropriate spacing to use for measurements.

Parameters:
  `list` - where to look for the top level DICOM pixel spacing related attributes
  `volumeGeometry` - if present, where to get the voxel spacing already derived from the DICOM attributes may be null, if not cross-sectional modality)
  `preferCalibratedValue` - if true, in the absence of 3D geometry, and presence of both Pixel Spacing and Imager Pixel Spacing with different values, use the former
  `useMagnificationFactorIfPresent` - if true, and preferCalibratedValue is false and there is no Pixel Spacing, adjust Imager Pixel Spacing based on mag factor, if absent, SID and SOD

### PixelSpacing

public PixelSpacing(AttributeList list, GeometryOfVolume volumeGeometry)

Extract the appropriate spacing to use for measurements.

Will prefer calibrated values, and ignore magnification factors

Parameters:
  `list` - where to look for the top level DICOM pixel spacing related attributes
  `volumeGeometry` - if present, where to get the voxel spacing already derived from the DICOM attributes may be null, if not cross-sectional modality)

### PixelSpacing

public PixelSpacing(AttributeList list)

Extract the appropriate spacing to use for measurements on projection radiographs or non-enhanced family cross-sectional images.

Will prefer calibrated values, and ignore magnification factors

Parameters:
  `list` - where to look for the top level DICOM pixel spacing related attributes

## Method Details

### getSpacing

public double getSpacing()

Get the spacing.

Returns:
  the spacing

### getDescription

public String getDescription()

Get the description.

Returns:
  the description

### toString

public String toString()

Get the spacing and the description as a String.

Overrides:
  `toString` in class `Object`
Returns:
  a string describing the spacing and the description