Package com.pixelmed.dicom

## Class PixelSpacing

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

-     public class PixelSpacing
      extends java.lang.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 java.lang.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

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `java.lang.String` | `getDescription()` | Get the description.
    `double` | `getSpacing()` | Get the spacing.
    `java.lang.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 Detail

    - #### spacing

          protected double spacing

    - #### description

          protected java.lang.String description

  - ### Constructor Detail

    - #### 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 Detail

    - #### getSpacing

          public double getSpacing()

      Get the spacing.

      Returns:
        the spacing

    - #### getDescription

          public java.lang.String getDescription()

      Get the description.

      Returns:
        the description

    - #### toString

          public java.lang.String toString()

      Get the spacing and the description as a String.

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