|
|
|
@ -261,9 +261,27 @@ double itkImageProcessor::GetSCD1(){
|
|
|
|
|
}
|
|
|
|
|
double itkImageProcessor::GetSCD2(){
|
|
|
|
|
return
|
|
|
|
|
m_DRTImage1MetaInfo ->GetSCD();
|
|
|
|
|
m_DRTImage2MetaInfo ->GetSCD();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void itkImageProcessor::SetPanelOffsets(double dOff1, double dOff2)
|
|
|
|
|
{
|
|
|
|
|
m_DRTGeometryMetaInfo->SetPanel1Offset(dOff1);
|
|
|
|
|
m_DRTGeometryMetaInfo->SetPanel2Offset(dOff2);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
double itkImageProcessor::GetPanelOffset1(){
|
|
|
|
|
return
|
|
|
|
|
m_DRTGeometryMetaInfo->GetPanel1Offset();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
double itkImageProcessor::GetPanelOffset2(){
|
|
|
|
|
return
|
|
|
|
|
m_DRTGeometryMetaInfo ->GetPanel2Offset();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void itkImageProcessor::SetDegreeOfFreedom(tDegreeOfFreedomEnum dof)
|
|
|
|
|
{
|
|
|
|
|
m_TransformMetaInfo->SetDegreeOfFreedom(dof);
|
|
|
|
@ -2160,11 +2178,11 @@ void itkImageProcessor::UpdateProjectionGeometryMeta(){
|
|
|
|
|
IsocenterOffsetLPS = m_CTMetaInfo->ConvertIECPointToLPSPoint(
|
|
|
|
|
m_DRTGeometryMetaInfo->GetProjectionCenterOffset1());
|
|
|
|
|
|
|
|
|
|
// std::cout<< "///////////////// PGEOM META BEG ///////////////" <<std::endl;
|
|
|
|
|
// std::cout<<"NominalIsocenter IEC"<< m_DRTGeometryMetaInfo->GetProjectionCenter() <<std::endl;
|
|
|
|
|
// std::cout<<"CALIBRATION NominalIsocenter_wZcorrectionLPS "<<NominalIsocenter_wZcorrectionLPS<<std::endl;
|
|
|
|
|
// std::cout<<"CALIBRATION NominalIsocenterZero_wZcorrectionLPS "<<NominalIsocenterZero_wZcorrectionLPS<<std::endl;
|
|
|
|
|
// std::cout<<"CALIBRATION IsocenterOffsetLPS "<<IsocenterOffsetLPS<<std::endl;
|
|
|
|
|
std::cout<< "///////////////// PGEOM META BEG ///////////////" <<std::endl;
|
|
|
|
|
std::cout<<"NominalIsocenter IEC"<< m_DRTGeometryMetaInfo->GetProjectionCenter() <<std::endl;
|
|
|
|
|
std::cout<<"CALIBRATION NominalIsocenter_wZcorrectionLPS "<<NominalIsocenter_wZcorrectionLPS<<std::endl;
|
|
|
|
|
std::cout<<"CALIBRATION NominalIsocenterZero_wZcorrectionLPS "<<NominalIsocenterZero_wZcorrectionLPS<<std::endl;
|
|
|
|
|
std::cout<<"CALIBRATION IsocenterOffsetLPS "<<IsocenterOffsetLPS<<std::endl;
|
|
|
|
|
|
|
|
|
|
ImageType3D::PointType CalibratedIsocenterLPS;
|
|
|
|
|
|
|
|
|
@ -2175,6 +2193,7 @@ void itkImageProcessor::UpdateProjectionGeometryMeta(){
|
|
|
|
|
CalibratedIsocenterLPS[2] = NominalIsocenter_wZcorrectionLPS[2] +
|
|
|
|
|
IsocenterOffsetLPS[2];
|
|
|
|
|
|
|
|
|
|
std::cout<<"CALIBRATION CalibratedIsocenterLPS "<<CalibratedIsocenterLPS<<std::endl;
|
|
|
|
|
|
|
|
|
|
ImageType3D::PointType CalibratedIsocenterZeroLPS;
|
|
|
|
|
|
|
|
|
@ -2184,6 +2203,7 @@ void itkImageProcessor::UpdateProjectionGeometryMeta(){
|
|
|
|
|
IsocenterOffsetLPS[1];
|
|
|
|
|
CalibratedIsocenterZeroLPS[2] = NominalIsocenterZero_wZcorrectionLPS[2] +
|
|
|
|
|
IsocenterOffsetLPS[2];
|
|
|
|
|
std::cout<<"CALIBRATION CalibratedIsocenterZeroLPS "<<CalibratedIsocenterZeroLPS<<std::endl;
|
|
|
|
|
|
|
|
|
|
m_DRTImage1MetaInfo->SetProjectionAngleLPS(
|
|
|
|
|
this->CalcProjectionAngleLPS(
|
|
|
|
@ -2203,11 +2223,11 @@ void itkImageProcessor::UpdateProjectionGeometryMeta(){
|
|
|
|
|
m_DRTImage1MetaInfo->SetProjectionOriginLPSZero(
|
|
|
|
|
CalibratedIsocenterZeroLPS);
|
|
|
|
|
|
|
|
|
|
// This is based on the calibrated iso to be sure...
|
|
|
|
|
std::vector <double> vBounds = m_CTMetaInfo->CalculateRegions(
|
|
|
|
|
NominalIsocenter_wZcorrectionLPS
|
|
|
|
|
// m_DRTImage1MetaInfo->GetProjectionOriginLPS()
|
|
|
|
|
);
|
|
|
|
|
// // This is based on the calibrated iso to be sure...
|
|
|
|
|
// std::vector <double> vBounds = m_CTMetaInfo->CalculateRegions(
|
|
|
|
|
// NominalIsocenter_wZcorrectionLPS
|
|
|
|
|
//// m_DRTImage1MetaInfo->GetProjectionOriginLPS()
|
|
|
|
|
// );
|
|
|
|
|
|
|
|
|
|
// std::cout<<"Bounds1: "
|
|
|
|
|
// <<vBounds.data()[0]<<" "
|
|
|
|
@ -2218,12 +2238,18 @@ void itkImageProcessor::UpdateProjectionGeometryMeta(){
|
|
|
|
|
// <<vBounds.data()[5]<<std::endl;
|
|
|
|
|
|
|
|
|
|
m_DRTImage1MetaInfo->SetSizeWithBounds(
|
|
|
|
|
vBounds.data(),
|
|
|
|
|
NULL,//vBounds.data(),
|
|
|
|
|
m_DRTGeometryMetaInfo->GetDRT1Size(),
|
|
|
|
|
m_DRTGeometryMetaInfo->GetDRT1Spacing()
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ImageType3D::PointType PanelOffsetIEC1;
|
|
|
|
|
|
|
|
|
|
PanelOffsetIEC1[0] = -m_DRTGeometryMetaInfo->GetPanel1Offset();
|
|
|
|
|
PanelOffsetIEC1[1] = 0.0;
|
|
|
|
|
PanelOffsetIEC1[2] = 0.0;
|
|
|
|
|
|
|
|
|
|
// This HAS TO be calculated from the nominal isocenter.
|
|
|
|
|
m_DRTImage1MetaInfo->SetOriginLPS(
|
|
|
|
|
CalcDRTImageOrigin(
|
|
|
|
@ -2235,8 +2261,17 @@ void itkImageProcessor::UpdateProjectionGeometryMeta(){
|
|
|
|
|
m_DRTGeometryMetaInfo->GetProjectionAngle1IEC() ),
|
|
|
|
|
//m_DRTGeometryMetaInfo->GetProjectionAngle1IEC(),// m_DRTImage1MetaInfo->GetProjectionAngleLPS(),
|
|
|
|
|
Std_DRT2LPS
|
|
|
|
|
) -
|
|
|
|
|
CalcDRTImageOffset(
|
|
|
|
|
PanelOffsetIEC1,
|
|
|
|
|
this->CalcProjectionAngleLPS(
|
|
|
|
|
m_CTMetaInfo->GetPatientOrientation(),
|
|
|
|
|
m_DRTGeometryMetaInfo->GetProjectionAngle1IEC() ),
|
|
|
|
|
Std_DRT2LPS
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
);
|
|
|
|
|
std::cout<<"CALIBRATION GetOriginLPS "<<m_DRTImage1MetaInfo->GetOriginLPS()<<std::endl;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -2255,8 +2290,15 @@ void itkImageProcessor::UpdateProjectionGeometryMeta(){
|
|
|
|
|
// std::cout<<"m_DRTImage1MetaInfo->GetSize()"<< m_DRTImage1MetaInfo->GetSize() <<std::endl;
|
|
|
|
|
// std::cout<<"m_DRTImage1MetaInfo->GetSpacing()"<< m_DRTImage1MetaInfo->GetSpacing() <<std::endl;
|
|
|
|
|
// std::cout<<"m_DRTImage1MetaInfo->GetOrigin()"<< m_DRTImage1MetaInfo->GetOrigin() <<std::endl;
|
|
|
|
|
std::cout<<"CalcDRTImageOffset1"<< CalcDRTImageOffset(
|
|
|
|
|
PanelOffsetIEC1,
|
|
|
|
|
this->CalcProjectionAngleLPS(
|
|
|
|
|
m_CTMetaInfo->GetPatientOrientation(),
|
|
|
|
|
m_DRTGeometryMetaInfo->GetProjectionAngle1IEC() ),
|
|
|
|
|
Std_DRT2LPS
|
|
|
|
|
) <<std::endl;
|
|
|
|
|
// std::cout<<"m_DRTImage1MetaInfo->GetCOV()"<< m_DRTImage1MetaInfo->GetCOV() <<std::endl;
|
|
|
|
|
// std::cout<<"m_DRTImage1MetaInfo->GetOriginLPS()"<< m_DRTImage1MetaInfo->GetOriginLPS() <<std::endl;
|
|
|
|
|
std::cout<<"m_DRTImage1MetaInfo->GetOriginLPS()"<< m_DRTImage1MetaInfo->GetOriginLPS() <<std::endl;
|
|
|
|
|
// std::cout<<"m_DRTImage1MetaInfo->GetProjectionAngleLPS()"<<m_DRTImage1MetaInfo->GetProjectionAngleLPS()<<std::endl;
|
|
|
|
|
// std::cout<<"m_DRTImage1MetaInfo->GetImageDirectionsLPS()"<< m_DRTImage1MetaInfo->GetImageDirectionsLPS() <<std::endl;
|
|
|
|
|
|
|
|
|
@ -2307,10 +2349,10 @@ void itkImageProcessor::UpdateProjectionGeometryMeta(){
|
|
|
|
|
// m_DRTGeometryMetaInfo->GetProjectionCenter2())
|
|
|
|
|
// );
|
|
|
|
|
|
|
|
|
|
vBounds.clear();
|
|
|
|
|
vBounds = m_CTMetaInfo->CalculateRegions(
|
|
|
|
|
NominalIsocenter_wZcorrectionLPS//m_DRTImage2MetaInfo->GetProjectionOriginLPS()
|
|
|
|
|
);
|
|
|
|
|
// vBounds.clear();
|
|
|
|
|
// vBounds = m_CTMetaInfo->CalculateRegions(
|
|
|
|
|
// NominalIsocenter_wZcorrectionLPS//m_DRTImage2MetaInfo->GetProjectionOriginLPS()
|
|
|
|
|
// );
|
|
|
|
|
|
|
|
|
|
// std::cout<<"Bounds2: "
|
|
|
|
|
// <<vBounds.data()[0]<<" "
|
|
|
|
@ -2321,11 +2363,19 @@ void itkImageProcessor::UpdateProjectionGeometryMeta(){
|
|
|
|
|
// <<vBounds.data()[5]<<std::endl;
|
|
|
|
|
|
|
|
|
|
m_DRTImage2MetaInfo->SetSizeWithBounds(
|
|
|
|
|
vBounds.data(),
|
|
|
|
|
NULL,//vBounds.data(),
|
|
|
|
|
m_DRTGeometryMetaInfo->GetDRT2Size(),
|
|
|
|
|
m_DRTGeometryMetaInfo->GetDRT2Spacing()
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ImageType3D::PointType PanelOffsetIEC2;
|
|
|
|
|
|
|
|
|
|
PanelOffsetIEC2[0] = -m_DRTGeometryMetaInfo->GetPanel2Offset();
|
|
|
|
|
PanelOffsetIEC2[1] = 0.0;
|
|
|
|
|
PanelOffsetIEC2[2] = 0.0;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
m_DRTImage2MetaInfo->SetOriginLPS(
|
|
|
|
|
CalcDRTImageOrigin(
|
|
|
|
|
m_DRTImage2MetaInfo->GetOrigin(),
|
|
|
|
@ -2336,7 +2386,30 @@ void itkImageProcessor::UpdateProjectionGeometryMeta(){
|
|
|
|
|
m_DRTGeometryMetaInfo->GetProjectionAngle2IEC()) ,
|
|
|
|
|
//m_DRTGeometryMetaInfo->GetProjectionAngle2IEC(),//m_DRTImage2MetaInfo->GetProjectionAngleLPS(),
|
|
|
|
|
Std_DRT2LPS
|
|
|
|
|
));
|
|
|
|
|
|
|
|
|
|
std::cout<<"m_DRTImage2MetaInfo->GetOriginLPS()"<< m_DRTImage2MetaInfo->GetOriginLPS() <<std::endl;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
m_DRTImage2MetaInfo->SetOriginLPS(
|
|
|
|
|
CalcDRTImageOrigin(
|
|
|
|
|
m_DRTImage2MetaInfo->GetOrigin(),
|
|
|
|
|
m_DRTImage2MetaInfo->GetCOV(),
|
|
|
|
|
NominalIsocenter_wZcorrectionLPS,//m_DRTImage2MetaInfo->GetProjectionOriginLPS(),
|
|
|
|
|
this->CalcProjectionAngleLPS(
|
|
|
|
|
m_CTMetaInfo->GetPatientOrientation(),
|
|
|
|
|
m_DRTGeometryMetaInfo->GetProjectionAngle2IEC()) ,
|
|
|
|
|
//m_DRTGeometryMetaInfo->GetProjectionAngle2IEC(),//m_DRTImage2MetaInfo->GetProjectionAngleLPS(),
|
|
|
|
|
Std_DRT2LPS
|
|
|
|
|
) -
|
|
|
|
|
CalcDRTImageOffset(
|
|
|
|
|
PanelOffsetIEC2,
|
|
|
|
|
this->CalcProjectionAngleLPS(
|
|
|
|
|
m_CTMetaInfo->GetPatientOrientation(),
|
|
|
|
|
m_DRTGeometryMetaInfo->GetProjectionAngle2IEC() ),
|
|
|
|
|
Std_DRT2LPS
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
m_DRTImage2MetaInfo->SetImageDirectionsLPS(
|
|
|
|
@ -2354,8 +2427,15 @@ void itkImageProcessor::UpdateProjectionGeometryMeta(){
|
|
|
|
|
// std::cout<<"m_DRTImage2MetaInfo->GetSize()"<< m_DRTImage2MetaInfo->GetSize() <<std::endl;
|
|
|
|
|
// std::cout<<"m_DRTImage2MetaInfo->GetSpacing()"<< m_DRTImage2MetaInfo->GetSpacing() <<std::endl;
|
|
|
|
|
// std::cout<<"m_DRTImage2MetaInfo->GetOrigin()"<< m_DRTImage2MetaInfo->GetOrigin() <<std::endl;
|
|
|
|
|
std::cout<<"CalcDRTImageOffset2"<< CalcDRTImageOffset(
|
|
|
|
|
PanelOffsetIEC2,
|
|
|
|
|
this->CalcProjectionAngleLPS(
|
|
|
|
|
m_CTMetaInfo->GetPatientOrientation(),
|
|
|
|
|
m_DRTGeometryMetaInfo->GetProjectionAngle2IEC() ),
|
|
|
|
|
Std_DRT2LPS
|
|
|
|
|
) <<std::endl;
|
|
|
|
|
// std::cout<<"m_DRTImage2MetaInfo->GetCOV()"<< m_DRTImage2MetaInfo->GetCOV() <<std::endl;
|
|
|
|
|
// std::cout<<"m_DRTImage2MetaInfo->GetOriginLPS()"<< m_DRTImage2MetaInfo->GetOriginLPS() <<std::endl;
|
|
|
|
|
std::cout<<"m_DRTImage2MetaInfo->GetOriginLPS() - Offset "<< m_DRTImage2MetaInfo->GetOriginLPS() <<std::endl;
|
|
|
|
|
// std::cout<<"m_DRTImage2MetaInfo->GetProjectionAngleLPS()"<<m_DRTImage2MetaInfo->GetProjectionAngleLPS()<<std::endl;
|
|
|
|
|
// std::cout<<"m_DRTImage2MetaInfo->GetImageDirectionsLPS()"<< m_DRTImage2MetaInfo->GetImageDirectionsLPS() <<std::endl;
|
|
|
|
|
|
|
|
|
@ -2389,6 +2469,23 @@ itkImageProcessor::CalcDRTImageOrigin(
|
|
|
|
|
NewOrigin;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
itkImageProcessor::ImageType3D::PointType
|
|
|
|
|
itkImageProcessor::CalcDRTImageOffset(
|
|
|
|
|
ImageType3D::PointType m_DRTOffset,
|
|
|
|
|
double dAngle,
|
|
|
|
|
InternalImageType::DirectionType stdDRT2LPS
|
|
|
|
|
){
|
|
|
|
|
|
|
|
|
|
itkImageProcessor::InternalImageType::DirectionType DRT2LPS
|
|
|
|
|
= this->CalcDRTImageDirections(dAngle, stdDRT2LPS);
|
|
|
|
|
|
|
|
|
|
ImageType3D::PointType NewOffset =
|
|
|
|
|
DRT2LPS * (m_DRTOffset);
|
|
|
|
|
|
|
|
|
|
return
|
|
|
|
|
NewOffset;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void itkImageProcessor::GetProjectionImages(){
|
|
|
|
|
|
|
|
|
@ -2997,13 +3094,13 @@ vtkImageData* itkImageProcessor::GetProjection2VTK()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// double* dBounds = toVTK2D2->GetOutput()->GetBounds();
|
|
|
|
|
double* dBounds = toVTK2D2->GetOutput()->GetBounds();
|
|
|
|
|
|
|
|
|
|
// std::cout<< "-------- Proj 2 --------" <<std::endl;
|
|
|
|
|
// std::cout<<"Bounds: "<<dBounds[0]<<" "<<dBounds[1]<<" "
|
|
|
|
|
// <<dBounds[2]<<" "<<dBounds[3]<<" "
|
|
|
|
|
// <<dBounds[4]<<" "<<dBounds[5]<<std::endl;
|
|
|
|
|
// std::cout<< "-------- -------- --------" <<std::endl;
|
|
|
|
|
std::cout<< "-------- Proj 2 --------" <<std::endl;
|
|
|
|
|
std::cout<<"Bounds: "<<dBounds[0]<<" "<<dBounds[1]<<" "
|
|
|
|
|
<<dBounds[2]<<" "<<dBounds[3]<<" "
|
|
|
|
|
<<dBounds[4]<<" "<<dBounds[5]<<std::endl;
|
|
|
|
|
std::cout<< "-------- -------- --------" <<std::endl;
|
|
|
|
|
|
|
|
|
|
return
|
|
|
|
|
toVTK2D2->GetOutput();
|
|
|
|
|