Loading...
Searching...
No Matches
FrameSorterIPP Class Reference

Sorter implementing the FrameSorter interface that sorts frames by their Image Position (Patient) attribute. More...

Inheritance diagram for FrameSorterIPP:

## Classes

struct | OrderedFrameItem
| Structure that holds a frame for sorting. More...

## Public Member Functions

| ~FrameSorterIPP ()
| Default constructor, does nothing.
OFString | getDescription ()
| Get description of the sorting algorithm this class uses.
void | getSliceDirection (Results &results)
| Get the slice direction from Image Orientation (Patient).
void | sort (Results &results)
| Performs actual sorting.
Public Member Functions inherited from FrameSorter
| FrameSorter ()
| Default constructor, does nothing.
void | setSorterInput (FGInterface *fg)
| Set input data for this sorter.
virtual | ~FrameSorter ()
| Virtual default desctructor, does nothing.

## Private Member Functions

OFVector< Float64 > | cross_3d (OFVector< Float64 > v1, OFVector< Float64 > v2)
| Calculate the cross product of two 3D vectors.
Float64 | dot (OFVector< Float64 > v1, OFVector< Float64 > v2)
| Calculate the dot product of two 3D vectors.
void | normalize (OFVector< Float64 > &v)
| Normalize a 3D vector.

## Static Private Member Functions

static int | compareIPPKeys (const void *a, const void *b)
| Compare function for qsort to sort OrderedFrameItem by their key.

## Private Attributes

OFVector< Float64 > | sliceDirection
| The slice direction vector.

## Additional Inherited Members

Protected Attributes inherited from FrameSorter
FGInterface * | m_fg
| Pointer to functional groups to work on. Not owned by this class.

## Detailed Description

Sorter implementing the FrameSorter interface that sorts frames by their Image Position (Patient) attribute.

The sorting is done by projecting the Image Position (Patient) on the slice direction (as defined by the Image Orientation (Patient) attribute).

## Member Function Documentation

## compareIPPKeys()

int FrameSorterIPP::compareIPPKeys | ( | const void * | a,
|  | const void * | b )

static private

Compare function for qsort to sort OrderedFrameItem by their key.

Compare function to compare OrderedFrameItem by their key.

Parameters

  a | Pointer to first OrderedFrameItem
  b | Pointer to second OrderedFrameItem

Returns
  Negative value if a < b, zero if a == b, positive if a > b

Parameters

  a | Pointer to first OrderedFrameItem
  b | Pointer to second OrderedFrameItem

Returns
  Returns 1 for a > b, -1 otherwise

References FrameSorterIPP::OrderedFrameItem::key.

Referenced by sort().

## cross_3d()

OFVector< Float64 > FrameSorterIPP::cross_3d | ( | OFVector< Float64 > | v1,
|  | OFVector< Float64 > | v2 )

inline private

Calculate the cross product of two 3D vectors.

Parameters

  v1 | First vector
  v2 | Second vector

Returns
  Cross product vector

References OFVector< T >::push_back().

Referenced by getSliceDirection().

## dot()

Float64 FrameSorterIPP::dot | ( | OFVector< Float64 > | v1,
|  | OFVector< Float64 > | v2 )

inline private

Calculate the dot product of two 3D vectors.

Parameters

  v1 | First vector
  v2 | Second vector

Returns
  Dot product value

Referenced by sort().

## getDescription()

OFString FrameSorterIPP::getDescription | ( |  | ) |

inline virtual

Get description of the sorting algorithm this class uses.

Returns
  Free text description of the sorting algorithm used.

Implements FrameSorter.

## getSliceDirection()

void FrameSorterIPP::getSliceDirection | ( | Results & | results | ) |

inline

Get the slice direction from Image Orientation (Patient).

Parameters

  results | The results structure to hold error code in case of failure

References OFString::c_str(), cross_3d(), EC_Normal, DcmFGTypes::EFG_PLANEORIENTPATIENT, FrameSorter::Results::errorCode, FG_EC_InvalidData, FGPlaneOrientationPatient::getImageOrientationPatient(), OFCondition::good(), FrameSorter::m_fg, normalize(), OFVector< T >::push_back(), and sliceDirection.

Referenced by sort().

## normalize()

void FrameSorterIPP::normalize | ( | OFVector< Float64 > & | v | ) |

inline private

Normalize a 3D vector.

Parameters

  v | The vector to normalize (output parameter)

References OFMath::sqrt().

Referenced by getSliceDirection().

## sort()

void FrameSorterIPP::sort | ( | Results & | results | ) |

inline virtual

Performs actual sorting.

Sets given results.

Parameters

  results | The results produced by IPP sorter (list of frame numbers sorted by Image Position (Patient) projection on slice direction, and EC_Normal as error code in case of success)

Implements FrameSorter.

References OFString::c_str(), compareIPPKeys(), DcmFGTypes::DCMFG_MAX_FRAMES, dot(), EC_Normal, DcmFGTypes::EFG_PLANEPOSPATIENT, FrameSorter::Results::errorCode, FG_EC_InvalidData, FG_EC_TooManyItems, FrameSorterIPP::OrderedFrameItem::frameId, FrameSorter::Results::frameNumbers, FrameSorterIPP::OrderedFrameItem::framePos, FrameSorter::Results::framePositions, FGPlanePosPatient::getImagePositionPatient(), getSliceDirection(), OFCondition::good(), FrameSorterIPP::OrderedFrameItem::key, FrameSorter::m_fg, OFVector< T >::push_back(), and sliceDirection.

The documentation for this class was generated from the following file:

- dcmfg/include/dcmtk/dcmfg/framesorter.h

Generated on for DCMTK Version 3.7.0 by Doxygen 1.15.0