DCMTK Version 3.7.0 OFFIS DICOM Toolkit

Classes | Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
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. More...
void | getSliceDirection (Results &results)
| Get the slice direction from Image Orientation (Patient) More...
void | sort (Results &results)
| Performs actual sorting. More...
Public Member Functions inherited from FrameSorter
| FrameSorter ()
| Default constructor, does nothing.
void | setSorterInput (FGInterface *fg)
| Set input data for this sorter. More...
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. More...
Float64 | dot (OFVector< Float64 > v1, OFVector< Float64 > v2)
| Calculate the dot product of two 3D vectors. More...
void | normalize (OFVector< Float64 > &v)
| Normalize a 3D vector. More...

## Static Private Member Functions
static int | compareIPPKeys (const void *a, const void *b)
| Compare function for qsort to sort OrderedFrameItem by their key. More...

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

## ◆ 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().

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

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

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().

## ◆ 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 DcmFGTypes::DCMFG_MAX_FRAMES, EC_Normal, FrameSorter::Results::errorCode, FG_EC_InvalidData, FG_EC_TooManyItems, FGInterface::getNumberOfFrames(), getSliceDirection(), and FrameSorter::m_fg.

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

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

Generated on Mon Dec 15 2025 for DCMTK Version 3.7.0 by Doxygen 1.9.1