MeVisLab Toolbox Reference
MarkerConversion.h
Go to the documentation of this file.
1 // Copyright (c) Fraunhofer MEVIS, Germany. All rights reserved.
2 // **InsertLicense** code
3 //----------------------------------------------------------------------------------
5 
10 #pragma once
11 
12 #include "MarkerConversionSystem.h"
13 #if defined(MLAB_CMAKE_BUILDSYSTEM)
14 #include "mlPrintTemplateErrors.h"
15 #endif
16 #include <mlTypeDefs.h>
17 #include "mlUtilsAPI.h"
18 #include <mlMatrix4.h> // Matrix4 cannot (with my knowledge) be forward declared because it is a typedef for a template
19 
20 ML_START_NAMESPACE
21 
22 class XMarker;
23 class XMarkerList;
24 class MedicalImageProperties;
25 
26 namespace marker_conversion {
27 
28  namespace ConversionMode {
29  typedef enum
30  {
37  COUNT
38  } Type;
39  };
40 
41  namespace SelectedComponents {
42  typedef enum {
43  Position = 0,
45  COUNT
46  } Type;
47  };
48 
49  // Note: inline this class and do NOT export since this would lead to C4275 because of not-expotability of std::runtime_error.
50  class MissingReferenceImagePropertiesException : public std::runtime_error
51  {
52  public:
53  inline MissingReferenceImagePropertiesException( const std::string& message ) : std::runtime_error( message ) { };
54  };
55 
57 
62  XMarkerList& markerList, ConversionMode::Type conversionMode, SelectedComponents::Type selectedComponents,
63  const MedicalImageProperties* referenceImage );
64 
67 
71  XMarkerList& list, SelectedComponents::Type selectedComponents,
72  const Matrix4& transformation );
73 
77  XMarker& marker, SelectedComponents::Type selectedComponents,
78  const ml::Matrix4& transformation );
79 
82 
89  XMarkerList& markerList_voxel, SelectedComponents::Type selectedComponents );
90 
97  XMarker& marker, SelectedComponents::Type selectedComponents );
98 
106  XMarkerList& markerList, SelectedComponents::Type selectedComponents );
107 
115  XMarker& marker, SelectedComponents::Type selectedComponents );
116 
123  XMarkerList& markerList, SelectedComponents::Type selectedComponents,
124  const ml::MedicalImageProperties& referenceImageProps );
125 
132  XMarker& marker, SelectedComponents::Type selectedComponents,
133  const ml::MedicalImageProperties& referenceImageProps );
134 
138  XMarkerList& markerList, SelectedComponents::Type selectedComponents,
139  const ml::MedicalImageProperties& referenceImageProps );
140 
144  XMarker& marker, SelectedComponents::Type selectedComponents,
145  const ml::MedicalImageProperties& referenceImageProps );
146 
150  XMarkerList& markerList, SelectedComponents::Type selectedComponents,
151  const ml::MedicalImageProperties& referenceImageProps );
152 
156  XMarker& marker, SelectedComponents::Type selectedComponents,
157  const ml::MedicalImageProperties& referenceImageProps );
158 
162  XMarkerList& markerList, SelectedComponents::Type selectedComponents,
163  const ml::MedicalImageProperties& referenceImageProps );
164 
171  XMarker& marker, SelectedComponents::Type selectedComponents,
172  const ml::MedicalImageProperties& referenceImageProps );
173 
177 }
178 
179 ML_END_NAMESPACE
#define MARKERCONVERSION_EXPORT
This class encapsulates basic medical image properties:
Base object class XMarkerList (derived from BaseListTemplate) specialized for XMarker items.
Base object class XMarker (derived form baseItem) with 6D pos, 3D vec and type int.
Definition: mlXMarkerList.h:52
void MARKERCONVERSION_EXPORT ConvertIntegerToFloatVoxelMarker(XMarker &marker, SelectedComponents::Type selectedComponents)
Converts a marker from integer (=index) voxel coordinates to floating point (=continuous) voxel coord...
void MARKERCONVERSION_EXPORT ConvertFloatVoxelToWorldMarkerList(XMarkerList &markerList, SelectedComponents::Type selectedComponents, const ml::MedicalImageProperties &referenceImageProps)
Converts a marker list from floating point (=continuous) voxel coordinates to world coordinates using...
void MARKERCONVERSION_EXPORT ConvertIntegerToFloatVoxelMarkerList(XMarkerList &markerList, SelectedComponents::Type selectedComponents)
Converts a marker list from integer (=index) voxel coordinates to floating point (=continuous) voxel ...
void MARKERCONVERSION_EXPORT ConvertIntegerVoxelToWorldMarkerList(XMarkerList &markerList, SelectedComponents::Type selectedComponents, const ml::MedicalImageProperties &referenceImageProps)
Converts a marker list from integer (=index) voxel coordinates to world coordinates using referenceIm...
void MARKERCONVERSION_EXPORT ConvertMarkerList(XMarkerList &markerList, ConversionMode::Type conversionMode, SelectedComponents::Type selectedComponents, const MedicalImageProperties *referenceImage)
Converts the given markerList according to conversionMode and enableDirectionVectorConversion.
void MARKERCONVERSION_EXPORT ConvertFloatVoxelToWorldMarker(XMarker &marker, SelectedComponents::Type selectedComponents, const ml::MedicalImageProperties &referenceImageProps)
Converts a marker from floating point (=continuous) voxel coordinates to world coordinates using refe...
void MARKERCONVERSION_EXPORT ConvertFloatToIntegerVoxelMarker(XMarker &marker, SelectedComponents::Type selectedComponents)
Converts a marker from floating point (=continuous) voxel coordinates to integer (=index) voxel coord...
void MARKERCONVERSION_EXPORT ConvertWorldToIntegerVoxelMarkerList(XMarkerList &markerList, SelectedComponents::Type selectedComponents, const ml::MedicalImageProperties &referenceImageProps)
Converts a marker list from world coordinates to integer (=index) voxel coordinates using referenceIm...
void MARKERCONVERSION_EXPORT ConvertWorldToFloatVoxelMarker(XMarker &marker, SelectedComponents::Type selectedComponents, const ml::MedicalImageProperties &referenceImageProps)
Converts a marker from world coordinates to floating point (=continuous) voxel coordinates using refe...
bool MARKERCONVERSION_EXPORT IsDirectionVectorConversionEnabled(SelectedComponents::Type selectedComponents)
Returns 'true' if the direction vector is to be converted according to selectedComponents.
void MARKERCONVERSION_EXPORT ConvertIntegerVoxelToWorldMarker(XMarker &marker, SelectedComponents::Type selectedComponents, const ml::MedicalImageProperties &referenceImageProps)
Converts a marker from integer (=index) voxel coordinates to world coordinates using referenceImagePr...
void MARKERCONVERSION_EXPORT ConvertFloatToIntegerVoxelMarkerList(XMarkerList &markerList_voxel, SelectedComponents::Type selectedComponents)
Converts a marker list from floating point (=continuous) voxel coordinates to integer (=index) voxel ...
void MARKERCONVERSION_EXPORT ConvertWorldToIntegerVoxelMarker(XMarker &marker, SelectedComponents::Type selectedComponents, const ml::MedicalImageProperties &referenceImageProps)
Converts a marker from world coordinates to integer (=index) voxel coordinates using referenceImagePr...
void MARKERCONVERSION_EXPORT ApplyTransformationMatrixToMarkerList(XMarkerList &list, SelectedComponents::Type selectedComponents, const Matrix4 &transformation)
Transforms a given marker list using the transformation matrix T.
void MARKERCONVERSION_EXPORT ConvertWorldToFloatVoxelMarkerList(XMarkerList &markerList, SelectedComponents::Type selectedComponents, const ml::MedicalImageProperties &referenceImageProps)
Converts a marker list from world coordinates to floating point (=continuous) voxel coordinates using...
void MARKERCONVERSION_EXPORT ApplyTransformationMatrixToMarker(XMarker &marker, SelectedComponents::Type selectedComponents, const ml::Matrix4 &transformation)
Transforms a given marker using the transformation matrix T.