IPPSorter Implement a simple Image Position (Patient) sorter, along the Image Orientation (Patient) direction. This algorithm does NOT support duplicate and will FAIL in case of duplicate IPP.
More...
#include <gdcmIPPSorter.h>
IPPSorter Implement a simple Image Position (Patient) sorter, along the Image Orientation (Patient) direction. This algorithm does NOT support duplicate and will FAIL in case of duplicate IPP.
- Warning
- See special note for SetZSpacingTolerance when computing the ZSpacing from the IPP of each DICOM files (default tolerance for consistent spacing is: 1e-6mm)
For more information on Spacing, and how it is defined in DICOM, advanced users may refers to:
http://gdcm.sourceforge.net/wiki/index.php/Imager_Pixel_Spacing
- Bug:
- There are currently a couple of bugs in this implementation:
- Gantry Tilt is not considered
- Examples:
- Compute3DSpacing.cxx, gdcmorthoplanes.cxx, reslicesphere.cxx, and VolumeSorter.cxx.
gdcm::IPPSorter::IPPSorter |
( |
| ) |
|
double gdcm::IPPSorter::GetDirectionCosinesTolerance |
( |
| ) |
const |
|
inline |
double gdcm::IPPSorter::GetZSpacing |
( |
| ) |
const |
|
inline |
Read-only function to provide access to the computed value for the Z-Spacing The ComputeZSpacing must have been set to true before execution of sort algorithm. Call this function after calling Sort(); Z-Spacing will be 0 on 2 occasions:
- Sorting simply failed, potentially duplicate IPP => ZSpacing = 0
- ZSpacing could not be computed (Z-Spacing is not constant, or ZTolerance is too low)
- Examples:
- Compute3DSpacing.cxx, gdcmorthoplanes.cxx, and reslicesphere.cxx.
double gdcm::IPPSorter::GetZSpacingTolerance |
( |
| ) |
const |
|
inline |
void gdcm::IPPSorter::SetComputeZSpacing |
( |
bool |
b | ) |
|
|
inline |
void gdcm::IPPSorter::SetDirectionCosinesTolerance |
( |
double |
tol | ) |
|
|
inline |
Sometimes IOP along a series is slightly changing for example: "0.999081\\0.0426953\\0.00369272\\-0.0419025\\0.955059\\0.293439", "0.999081\\0.0426953\\0.00369275\\-0.0419025\\0.955059\\0.293439", "0.999081\\0.0426952\\0.00369272\\-0.0419025\\0.955059\\0.293439", We need an API to define the tolerance which is allowed. Internally the cross vector of each direction cosines is computed. The tolerance then define the the distance in between 1. to the dot product of those cross vectors. In a perfect world this dot product is of course 1.0 which imply a DirectionCosines tolerance of exactly 0.0 (default).
void gdcm::IPPSorter::SetDropDuplicatePositions |
( |
bool |
b | ) |
|
|
inline |
Makes the IPPSorter ignore multiple images located at the same position. Only the first occurence will be kept. DropDuplicatePositions defaults to false.
void gdcm::IPPSorter::SetZSpacingTolerance |
( |
double |
tol | ) |
|
|
inline |
virtual bool gdcm::IPPSorter::Sort |
( |
std::vector< std::string > const & |
filenames | ) |
|
|
virtual |
Main entry point to the sorter. It will execute the filter, option should be set before running this function (SetZSpacingTolerance, ...) Return value indicate if sorting could be achived. Warning this does NOT imply that spacing is consistent, it only means the file are sorted according to IPP You should check if ZSpacing is 0 or not to deduce if file are actually a 3D volume
Reimplemented from gdcm::Sorter.
- Examples:
- Compute3DSpacing.cxx, gdcmorthoplanes.cxx, reslicesphere.cxx, and VolumeSorter.cxx.
bool gdcm::IPPSorter::ComputeZSpacing |
|
protected |
double gdcm::IPPSorter::DirCosTolerance |
|
protected |
bool gdcm::IPPSorter::DropDuplicatePositions |
|
protected |
double gdcm::IPPSorter::ZSpacing |
|
protected |
double gdcm::IPPSorter::ZTolerance |
|
protected |
The documentation for this class was generated from the following file: