Files
reg23Topograms/itkReg23DRT/DRTMetaInformation.h
2025-05-14 23:20:02 +02:00

724 lines
17 KiB
C++

#ifndef DRTMETAINFORMATION_H
#define DRTMETAINFORMATION_H
#include "itkObject.h"
#include "itkObjectFactory.h"
#include "itkSmartPointer.h"
#include "itkMacro.h"
#include "itkImage.h"
namespace itk
{
typedef enum eProjectionOrientationType{
NA = 0,
LAT=2,
PA=1
} tProjOrientationType;
/** Enum type for Orientation */
typedef enum eImageOrientationType{
NotDefined = 0,
HFS = 1,
FFS = 2
} tPatOrientation;
typedef enum eHandlingRotImpTransform {
ALWAYS_USE = 0,
NEVER_USE =1,
STATION_DEPENDENT=2
} tHandlingRotImpTransform;
typedef enum eDegreeOfFreedomType {
UNKNOWN = 0,
THREE_DOF =1,
SIX_DOF =2 ,
X_ONLY =3 ,
Y_ONLY =4,
Z_ONLY =5 ,
ROTATION_ONLY =6,
OTHER =7
} tDegreeOfFreedomEnum;
typedef enum eOptimizerType{
POWELL = 0,
AMOEBA = 1,
EXHAUSTIVE =2
} tOptimizerTypeEnum;
typedef enum eMetricType{
NCC = 0,
MI = 1
} tMetricTypeEnum;
inline int GetNumberOfDOF(eDegreeOfFreedomType dof)
{
switch (dof) {
case SIX_DOF:
return 6;
break;
case THREE_DOF:
case ROTATION_ONLY:
return 3;
break;
case X_ONLY:
case Y_ONLY:
case Z_ONLY:
return 1;
break;
default:
return 0;
}
return 0;
};
class DegreeOfFreedom : public itk::Object {
public:
typedef DegreeOfFreedom Self;
typedef itk::Object Superclass;
typedef itk::SmartPointer<Self> Pointer;
itkNewMacro(Self);
protected:
bool
m_TranslationX,
m_TranslationY,
m_TranslationZ,
m_RotationX,
m_RotationY,
m_RotationZ;
tDegreeOfFreedomEnum m_dof;
};
class TopogramImageMetaInformation :
public itk::Object{
public:
/** standard typedefs **/
typedef TopogramImageMetaInformation Self;
typedef itk::Object Superclass;
typedef itk::SmartPointer<Self> Pointer;
typedef itk::Matrix<double, 3, 3> DirectionType;
/** Method for creation through the object factory. */
itkNewMacro(Self);
/** Run-time type information (and related methods). */
itkTypeMacro(TopogramImageMetaInformation, itk::Object);
/** object information streaming **/
void PrintSelf(std::ostream& os, itk::Indent indent) const;
void SetPatientOrientation(tPatOrientation);
itkGetEnumMacro(PatientOrientation, tPatOrientation);
itkSetEnumMacro(ProjectionOrientation, tProjOrientationType);
itkGetEnumMacro(ProjectionOrientation, tProjOrientationType);
itkSetMacro(WLLevel,double);
itkGetMacro(WLLevel,double);
itkSetMacro(WLWindow,double);
itkGetMacro(WLWindow,double);
itkSetMacro(LPS2IECDirections,DirectionType);
itkGetMacro(LPS2IECDirections,DirectionType);
protected:
tPatOrientation
m_PatientOrientation;
tProjOrientationType
m_ProjectionOrientation;
/** preferred level (windowing) **/
double m_WLLevel;
/** preferred window (windowing) **/
double m_WLWindow;
DirectionType
m_LPS2IECDirections;
/** Default Constructor **/
TopogramImageMetaInformation ();
/** Default Destructor **/
virtual ~TopogramImageMetaInformation ();
private:
/** purposely not implemented **/
TopogramImageMetaInformation (const Self&);
/** purposely not implemented **/
void operator=(const Self&);
};
class DRTImageMetaInformation :
public itk::Object{
public:
/** standard typedefs **/
typedef DRTImageMetaInformation Self;
typedef itk::Object Superclass;
typedef itk::SmartPointer<Self> Pointer;
typedef itk::Point<double, 3> PointType;
typedef itk::Vector<double, 3> SpacingType;
//typedef itk::FixedArray<unsigned int, 3> SizeType;
typedef itk::Size<3> SizeType;
typedef itk::Matrix<double, 3, 3> DirectionType;
/** Method for creation through the object factory. */
itkNewMacro(Self);
/** Run-time type information (and related methods). */
itkTypeMacro(DRTImageMetaInformation, itk::Object);
/** object information streaming **/
void PrintSelf(std::ostream& os, itk::Indent indent) const;
itkSetMacro(Size,SizeType);
itkGetMacro(Size,SizeType);
itkSetMacro(Spacing,SpacingType);
itkGetMacro(Spacing,SpacingType);
itkSetMacro(OriginLPS,PointType);
itkGetMacro(OriginLPS,PointType);
itkSetMacro(ProjectionOriginLPS,PointType);
itkGetMacro(ProjectionOriginLPS,PointType);
itkSetMacro(ProjectionOriginLPSZero,PointType);
itkGetMacro(ProjectionOriginLPSZero,PointType);
itkSetMacro(PanelOffsetPGeo,double);
itkGetMacro(PanelOffsetPGeo,double);
itkSetMacro(ProjectionAngleLPS,double);
itkGetMacro(ProjectionAngleLPS,double);
itkSetMacro(SCD,double);
itkGetMacro(SCD,double);
itkSetMacro(ImageDirectionsLPS,DirectionType);
itkGetMacro(ImageDirectionsLPS,DirectionType);
PointType GetCOV();
PointType GetLPStoProjectionGeoLPSOffset();
void SetSizeWithBounds(double*, SizeType, SpacingType);
PointType GetOrigin();
protected:
SizeType
m_Size;
SpacingType
m_Spacing;
PointType
//m_Origin,
m_OriginLPS,
m_ProjectionOriginLPS,
m_ProjectionOriginLPSZero;
double
m_ProjectionAngleLPS,
m_SCD,
m_PanelOffsetPGeo;
DirectionType
m_ImageDirectionsLPS;
/** Default Constructor **/
DRTImageMetaInformation ();
/** Default Destructor **/
virtual ~DRTImageMetaInformation ();
private:
/** purposely not implemented **/
DRTImageMetaInformation(const Self&);
/** purposely not implemented **/
void operator=(const Self&);
};
class CTVolumeImageMetaInformation :
public itk::Object{
public:
/** standard typedefs **/
typedef CTVolumeImageMetaInformation Self;
typedef itk::Object Superclass;
typedef itk::SmartPointer<Self> Pointer;
typedef itk::Matrix<double, 3, 3> DirectionType;
typedef itk::Point<double, 3> PointType;
typedef itk::Vector<double, 3> SpacingType;
typedef itk::Size<3> SizeType;
/** Method for creation through the object factory. */
itkNewMacro(Self);
/** Run-time type information (and related methods). */
itkTypeMacro(CTVolumeImageMetaInformation , itk::Object);
/** object information streaming **/
void PrintSelf(std::ostream& os, itk::Indent indent) const;
void SetPatientOrientation(tPatOrientation);
itkGetEnumMacro(PatientOrientation, tPatOrientation);
itkSetMacro(Spacing,SpacingType);
itkGetMacro(Spacing,SpacingType);
itkSetMacro(Size,SizeType);
itkGetMacro(Size,SizeType);
itkSetMacro(OriginLPS,PointType);
itkGetMacro(OriginLPS,PointType);
itkSetMacro(ImportOffset,PointType);
itkGetMacro(ImportOffset,PointType);
itkSetMacro(ImageDirections,DirectionType);
itkGetMacro(ImageDirections,DirectionType);
itkGetMacro(LPS2IECDirections,DirectionType);
PointType GetCOV();
PointType GetOriginWOffset();
const std::vector <double> CalculateRegions(PointType pProjectionOriginLPS);
PointType ConvertIECPointToLPSPoint(
PointType IECPoint);
PointType GetProjectionOriginLPS(
PointType ProjectionCenter);
PointType GetProjectionOriginLPSZero(
PointType ProjectionCenter);
protected:
tPatOrientation
m_PatientOrientation;
SpacingType
m_Spacing;
SizeType
m_Size;
PointType
m_OriginLPS,
m_ImportOffset;
DirectionType
m_ImageDirections,
m_LPS2IECDirections;
/** Default Constructor **/
CTVolumeImageMetaInformation ();
/** Default Destructor **/
virtual ~CTVolumeImageMetaInformation ();
private:
/** purposely not implemented **/
CTVolumeImageMetaInformation (const Self&);
/** purposely not implemented **/
void operator=(const Self&);
};
class DRTProjectionGeometryImageMetaInformation :
public itk::Object{
public:
/** standard typedefs **/
typedef DRTProjectionGeometryImageMetaInformation Self;
typedef itk::Object Superclass;
typedef itk::SmartPointer<Self> Pointer;
typedef itk::Point<double, 3> PointType;
typedef itk::Vector<double, 3> SpacingType;
typedef itk::Size<3> SizeType;
/** Method for creation through the object factory. */
itkNewMacro(Self);
/** Run-time type information (and related methods). */
itkTypeMacro(DRTProjectionGeometryImageMetaInformation , itk::Object);
/** object information streaming **/
void PrintSelf(std::ostream& os, itk::Indent indent) const;
itkSetMacro(ProjectionAngle1IEC, double);
itkGetMacro(ProjectionAngle1IEC, double);
itkSetMacro(ProjectionAngle2IEC, double);
itkGetMacro(ProjectionAngle2IEC, double);
itkSetMacro(ProjectionAngle1OffsetIEC, double);
itkGetMacro(ProjectionAngle1OffsetIEC, double);
itkSetMacro(ProjectionAngle2OffsetIEC, double);
itkGetMacro(ProjectionAngle2OffsetIEC, double);
itkSetMacro(SCD1, double);
itkGetMacro(SCD1, double);
itkSetMacro(SCD2, double);
itkGetMacro(SCD2, double);
itkSetMacro(SCD1Offset, double);
itkGetMacro(SCD1Offset, double);
itkSetMacro(SCD2Offset, double);
itkGetMacro(SCD2Offset, double);
itkSetMacro(Panel1Offset, double);
itkGetMacro(Panel1Offset, double);
itkSetMacro(Panel2Offset, double);
itkGetMacro(Panel2Offset, double);
itkSetMacro(IntensityThreshold, double);
itkGetMacro(IntensityThreshold, double);
itkSetMacro(DRT1Size, SizeType);
itkGetMacro(DRT1Size, SizeType);
itkSetMacro(DRT2Size, SizeType);
itkGetMacro(DRT2Size, SizeType);
itkSetMacro(DRT1Spacing, SpacingType);
itkGetMacro(DRT1Spacing, SpacingType);
itkSetMacro(DRT2Spacing, SpacingType);
itkGetMacro(DRT2Spacing, SpacingType);
itkSetMacro(IECS2IECScannerT, PointType);
itkGetMacro(IECS2IECScannerT, PointType);
itkSetMacro(IECS2IECScannerR, PointType);
itkGetMacro(IECS2IECScannerR, PointType);
itkSetMacro(ProjectionCenterOffset1, PointType);
itkGetMacro(ProjectionCenterOffset1, PointType);
itkSetMacro(ProjectionCenterOffset2, PointType);
itkGetMacro(ProjectionCenterOffset2, PointType);
itkSetMacro(ProjectionCenter, PointType);
itkGetMacro(ProjectionCenter, PointType);
itkSetMacro(UseRotationsForHiddenTransform, bool);
itkGetMacro(UseRotationsForHiddenTransform, bool);
itkSetEnumMacro(DegreeOfFreedom, tDegreeOfFreedomEnum);
itkGetEnumMacro(DegreeOfFreedom, tDegreeOfFreedomEnum);
itkSetEnumMacro(HandleRotationImpOffset, tHandlingRotImpTransform);
itkGetEnumMacro(HandleRotationImpOffset, tHandlingRotImpTransform);
protected:
double
m_ProjectionAngle1IEC,
m_ProjectionAngle2IEC,
m_ProjectionAngle1OffsetIEC,
m_ProjectionAngle2OffsetIEC,
m_SCD1,
m_SCD2,
m_SCD1Offset,
m_SCD2Offset,
m_Panel1Offset,
m_Panel2Offset,
m_IntensityThreshold;
SizeType
m_DRT1Size,
m_DRT2Size;
SpacingType
m_DRT1Spacing,
m_DRT2Spacing;
PointType
/* Transform between IEC Support and
* IEC Scanner frame of reference */
m_IECS2IECScannerT,
m_IECS2IECScannerR;
PointType
/* center of projection in an IEC reference at
* Patient Origin of fixed images. Positionin scanner */
m_ProjectionCenter,
m_ProjectionCenterOffset1,
m_ProjectionCenterOffset2;
bool
m_UseRotationsForHiddenTransform;
tDegreeOfFreedomEnum
m_DegreeOfFreedom;
tHandlingRotImpTransform
m_HandleRotationImpOffset;
/** Default Constructor **/
DRTProjectionGeometryImageMetaInformation ();
/** Default Destructor **/
virtual ~DRTProjectionGeometryImageMetaInformation ();
private:
/** purposely not implemented **/
DRTProjectionGeometryImageMetaInformation (const Self&);
/** purposely not implemented **/
void operator=(const Self&);
};
class RTGeometryMetaInformation :
public itk::Object{
public:
/** standard typedefs **/
typedef RTGeometryMetaInformation Self;
typedef itk::Object Superclass;
typedef itk::SmartPointer<Self> Pointer;
typedef itk::Point<double, 3> PointType;
/** Method for creation through the object factory. */
itkNewMacro(Self);
/** Run-time type information (and related methods). */
itkTypeMacro(RTGeometryMetaInformation, itk::Object);
/** object information streaming **/
void PrintSelf(std::ostream& os, itk::Indent indent) const;
itkSetMacro(IsocenterLPS,PointType);
itkGetMacro(IsocenterLPS,PointType);
itkSetMacro(IsocenterIECS,PointType);
itkGetMacro(IsocenterIECS,PointType);
protected:
PointType
/* RT Plan isocenter in LPS coordinates */
m_IsocenterLPS,
/* RT Plan couch SETUP offset corresponding to
* the RT Plan isocenter */
m_IsocenterIECS;
/** Default Constructor **/
RTGeometryMetaInformation ();
/** Default Destructor **/
virtual ~RTGeometryMetaInformation ();
private:
/** purposely not implemented **/
RTGeometryMetaInformation (const Self&);
/** purposely not implemented **/
void operator=(const Self&);
};
class InternalTransformMetaInformation :
public itk::Object{
public:
/** standard typedefs **/
typedef InternalTransformMetaInformation Self;
typedef itk::Object Superclass;
typedef itk::SmartPointer<Self> Pointer;
typedef itk::Point<double, 3> PointType;
typedef itk::Matrix<double,3,3> TransformMatrixType;
/** Method for creation through the object factory. */
itkNewMacro(Self);
/** Run-time type information (and related methods). */
itkTypeMacro(InternalTransformMetaInformation, itk::Object);
/** object information streaming **/
void PrintSelf(std::ostream& os, itk::Indent indent) const;
itkSetMacro(pCalProjCenter,PointType);
itkSetMacro(pRTIsocenter,PointType);
itkSetMacro(IECtoLPSDirs,TransformMatrixType);
itkGetMacro(pCalProjCenter,PointType);
itkGetMacro(pRTIsocenter,PointType);
itkGetMacro(IECtoLPSDirs,TransformMatrixType);
protected:
PointType
m_pCalProjCenter,
m_pRTIsocenter;
TransformMatrixType
m_IECtoLPSDirs;
/** Default Constructor **/
InternalTransformMetaInformation ();
/** Default Destructor **/
virtual ~InternalTransformMetaInformation ();
private:
/** purposely not implemented **/
InternalTransformMetaInformation (const Self&);
/** purposely not implemented **/
void operator=(const Self&);
};
class R23MetaInformation :
public itk::Object{
public:
/** standard typedefs **/
typedef R23MetaInformation Self;
typedef itk::Object Superclass;
typedef itk::SmartPointer<Self> Pointer;
/** Method for creation through the object factory. */
itkNewMacro(Self);
/** Run-time type information (and related methods). */
itkTypeMacro(R23MetaInformation, itk::Object);
/** object information streaming **/
void PrintSelf(std::ostream& os, itk::Indent indent) const override;
itkSetEnumMacro(DegreeOfFreedom, tDegreeOfFreedomEnum);
itkGetEnumMacro(DegreeOfFreedom, tDegreeOfFreedomEnum);
itkSetEnumMacro(OptimizerType, tOptimizerTypeEnum);
itkGetEnumMacro(OptimizerType, tOptimizerTypeEnum);
itkSetEnumMacro(MetricType, tMetricTypeEnum);
itkGetEnumMacro(MetricType, tMetricTypeEnum);
protected:
tDegreeOfFreedomEnum
m_DegreeOfFreedom;
tOptimizerTypeEnum
m_OptimizerType;
tMetricTypeEnum
m_MetricType;
/** Default Constructor **/
R23MetaInformation ();
/** Default Destructor **/
virtual ~R23MetaInformation ();
private:
/** purposely not implemented **/
R23MetaInformation (const Self&);
/** purposely not implemented **/
void operator=(const Self&);
};
class TransformMetaInformation :
public itk::Object{
public:
/** standard typedefs **/
typedef TransformMetaInformation Self;
typedef itk::Object Superclass;
typedef itk::SmartPointer<Self> Pointer;
typedef itk::Point<double, 3> PointType;
typedef itk::Matrix<double,3,3> TransformMatrixType;
/** Method for creation through the object factory. */
itkNewMacro(Self);
/** Run-time type information (and related methods). */
itkTypeMacro(TransformMetaInformation, itk::Object);
/** object information streaming **/
void PrintSelf(std::ostream& os, itk::Indent indent) const;
itkSetMacro(HiddenTranslations,PointType);
itkGetMacro(HiddenTranslations,PointType);
itkSetMacro(HiddenRotations,PointType);
itkGetMacro(HiddenRotations,PointType);
itkSetMacro(UserTranslations,PointType);
itkGetMacro(UserTranslations,PointType);
itkSetMacro(UserRotations,PointType);
itkGetMacro(UserRotations,PointType);
PointType GetT();
PointType GetR();
protected:
PointType
m_HiddenTranslations,
m_HiddenRotations,
m_UserTranslations,
m_UserRotations;
/** Default Constructor **/
TransformMetaInformation ();
/** Default Destructor **/
virtual ~TransformMetaInformation ();
private:
/** purposely not implemented **/
TransformMetaInformation (const Self&);
/** purposely not implemented **/
void operator=(const Self&);
};
};
#endif