review of projection geometry definition
- introduction of CalculateInternalTransformV2 - Each projection maps the isocentric transform (RTIso COR) to its own projection center, including calibration offset. - Direct comparison with previous implementation of CalculateInternalTransform not done... yet. - Results on validation dataset are good. - This change was triggered by rather large errors (ca. 0.8mm) on validation dataset. - Both fakeIso and DCM RTPlan iso have been updated to V2.
This commit is contained in:
@ -1362,6 +1362,82 @@ void itkImageProcessor::CalculateExternalUserTransform(TransformType::Pointer tr
|
||||
m_TransformMetaInfo->SetUserRotations(LPStoIEC_Directions * rotationUser);
|
||||
}
|
||||
|
||||
itkImageProcessor::TransformType::Pointer
|
||||
itkImageProcessor::CalculateInternalTransformV2(
|
||||
ImageType3D::PointType m_TranslationOffset, //IEC
|
||||
ImageType3D::PointType m_RotationOffset, //IEC
|
||||
ImageType3D::PointType m_TranslationUser, //IEC
|
||||
ImageType3D::PointType m_RotationUser, //IEC
|
||||
ImageType3D::PointType m_CalibratedProjectionCenter, //LPS
|
||||
ImageType3D::PointType m_RTIsocenter, //LPS
|
||||
InternalImageType::DirectionType m_IECtoLPSDirections
|
||||
)
|
||||
{
|
||||
|
||||
//Convert all inputs into LPS
|
||||
|
||||
ImageType3D::PointType m_TOffsetLPS =
|
||||
m_IECtoLPSDirections * m_TranslationOffset;
|
||||
|
||||
ImageType3D::PointType m_ROffsetLPS =
|
||||
m_IECtoLPSDirections * m_RotationOffset;
|
||||
|
||||
ImageType3D::PointType m_TUserLPS =
|
||||
m_IECtoLPSDirections * m_TranslationUser;
|
||||
|
||||
ImageType3D::PointType m_RUserLPS =
|
||||
m_IECtoLPSDirections * m_RotationUser;
|
||||
|
||||
|
||||
// TransformType::Pointer IsocetricTransform = TransformType::New();
|
||||
// IsocetricTransform->SetComputeZYX(true);
|
||||
// IsocetricTransform->SetIdentity();
|
||||
|
||||
TransformType::OutputVectorType translation;
|
||||
translation[0] = m_TOffsetLPS[0] + m_TUserLPS[0];
|
||||
translation[1] = m_TOffsetLPS[1] + m_TUserLPS[1];
|
||||
translation[2] = m_TOffsetLPS[2] + m_TUserLPS[2];
|
||||
|
||||
// IsocetricTransform->SetTranslation(translation);
|
||||
|
||||
const double dtr = (atan(1.0) * 4.0) / 180.0;
|
||||
// IsocetricTransform->SetRotation(
|
||||
// dtr * m_ROffsetLPS[0] + dtr * m_RUserLPS[0],
|
||||
// dtr * m_ROffsetLPS[1] + dtr * m_RUserLPS[1],
|
||||
// dtr * m_ROffsetLPS[2] + dtr * m_RUserLPS[2]);
|
||||
|
||||
TransformType::OutputVectorType rotations;
|
||||
rotations[0] = m_ROffsetLPS[0] + m_RUserLPS[0];
|
||||
rotations[1] = m_ROffsetLPS[1] + m_RUserLPS[1];
|
||||
rotations[2] = m_ROffsetLPS[2] + m_RUserLPS[2];
|
||||
|
||||
|
||||
// ImageType3D::PointType m_TransformOrigin;
|
||||
// m_TransformOrigin.Fill(0.);
|
||||
// IsocetricTransform->SetCenter(
|
||||
// m_TransformOrigin );
|
||||
|
||||
// IsocetricTransform->Print(std::cout);
|
||||
|
||||
// Map offset to the projection center
|
||||
TransformType::Pointer m_outputTransform =
|
||||
MapTransformToNewOrigin (
|
||||
m_CalibratedProjectionCenter - m_RTIsocenter,
|
||||
translation,
|
||||
rotations
|
||||
);
|
||||
|
||||
std::cout<<m_outputTransform->GetTranslation()<<std::endl;
|
||||
std::cout<<m_outputTransform->GetCenter()<<std::endl;
|
||||
m_outputTransform->SetCenter(m_CalibratedProjectionCenter);
|
||||
std::cout<<m_outputTransform->GetTranslation()<<std::endl;
|
||||
std::cout<<m_outputTransform->GetCenter()<<std::endl;
|
||||
|
||||
return m_outputTransform;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
itkImageProcessor::TransformType::Pointer
|
||||
itkImageProcessor::CalculateInternalTransform(
|
||||
@ -1429,7 +1505,7 @@ itkImageProcessor::CalculateInternalTransform(
|
||||
m_ProjectionTransformCenter);
|
||||
|
||||
|
||||
std::cout<<m_OutputTransform<<std::endl;
|
||||
//std::cout<<m_OutputTransform<<std::endl;
|
||||
|
||||
return
|
||||
m_OutputTransform;
|
||||
@ -1547,6 +1623,19 @@ void itkImageProcessor::InitializeRegistration(
|
||||
m_CTMetaInfo->GetImportOffset(),
|
||||
IECtoLPS_Directions
|
||||
);
|
||||
// CurrTransform =
|
||||
// CalculateInternalTransform(
|
||||
// ZeroPoint ,
|
||||
// m_DRTGeometryMetaInfo->GetIECS2IECScannerR(),
|
||||
// m_TransformMetaInfo->GetTranslations(),
|
||||
// m_TransformMetaInfo->GetRotations(),
|
||||
// m_CTMetaInfo->GetProjectionOriginLPS(
|
||||
// m_DRTGeometryMetaInfo->GetProjectionCenter()
|
||||
// ),
|
||||
// m_RTMetaInfo->GetIsocenterLPS() - m_CTMetaInfo->GetImportOffset(),
|
||||
// m_CTMetaInfo->GetImportOffset(),
|
||||
// IECtoLPS_Directions
|
||||
// );
|
||||
|
||||
}
|
||||
|
||||
@ -1562,6 +1651,9 @@ void itkImageProcessor::InitializeRegistration(
|
||||
);
|
||||
transform1->SetCenter(
|
||||
m_DRTImage1MetaInfo->GetProjectionOriginLPSZero() );
|
||||
// transform1 ->SetCenter(
|
||||
// m_CTMetaInfo->GetProjectionOriginLPSZero(
|
||||
// m_DRTGeometryMetaInfo->GetProjectionCenter()));
|
||||
/********* END OF CALCULATE INTERNAL TRANSFORM FOR PROJ1 *********/
|
||||
|
||||
|
||||
@ -1602,6 +1694,19 @@ void itkImageProcessor::InitializeRegistration(
|
||||
m_CTMetaInfo->GetImportOffset(),
|
||||
IECtoLPS_Directions
|
||||
);
|
||||
// CurrTransform =
|
||||
// CalculateInternalTransform(
|
||||
// ZeroPoint ,
|
||||
// m_DRTGeometryMetaInfo->GetIECS2IECScannerR(),
|
||||
// m_TransformMetaInfo->GetTranslations(),
|
||||
// m_TransformMetaInfo->GetRotations(),
|
||||
// m_CTMetaInfo->GetProjectionOriginLPS(
|
||||
// m_DRTGeometryMetaInfo->GetProjectionCenter()
|
||||
// ),
|
||||
// m_RTMetaInfo->GetIsocenterLPS() - m_CTMetaInfo->GetImportOffset(),
|
||||
// m_CTMetaInfo->GetImportOffset(),
|
||||
// IECtoLPS_Directions
|
||||
// );
|
||||
|
||||
}
|
||||
transform2->SetComputeZYX(true);
|
||||
@ -1615,6 +1720,9 @@ void itkImageProcessor::InitializeRegistration(
|
||||
);
|
||||
transform2->SetCenter(
|
||||
m_DRTImage2MetaInfo->GetProjectionOriginLPSZero() );
|
||||
// transform2 ->SetCenter(
|
||||
// m_CTMetaInfo->GetProjectionOriginLPSZero(
|
||||
// m_DRTGeometryMetaInfo->GetProjectionCenter()));
|
||||
/********* END OF CALCULATE INTERNAL TRANSFORM FOR PROJ1 *********/
|
||||
|
||||
|
||||
@ -1844,49 +1952,72 @@ void itkImageProcessor::InitializeProjector()
|
||||
// m_DRTGeometryMetaInfo->GetProjectionCenter1());
|
||||
|
||||
|
||||
CurrTransform =
|
||||
CalculateInternalTransform(
|
||||
ZeroPoint,
|
||||
ZeroPoint,
|
||||
m_TransformMetaInfo->GetTranslations(),
|
||||
m_TransformMetaInfo->GetRotations(),
|
||||
m_DRTImage1MetaInfo->GetProjectionOriginLPS(),
|
||||
pFakeIsoLPS,
|
||||
ZeroPoint,
|
||||
IECtoLPS_Directions
|
||||
);
|
||||
// CurrTransform =
|
||||
// CalculateInternalTransform(
|
||||
// ZeroPoint,
|
||||
// ZeroPoint,
|
||||
// m_TransformMetaInfo->GetTranslations(),
|
||||
// m_TransformMetaInfo->GetRotations(),
|
||||
// m_DRTImage1MetaInfo->GetProjectionOriginLPS(),
|
||||
// pFakeIsoLPS,
|
||||
// ZeroPoint,
|
||||
// IECtoLPS_Directions
|
||||
// );
|
||||
|
||||
CurrTransform = CalculateInternalTransformV2(
|
||||
ZeroPoint ,
|
||||
ZeroPoint ,
|
||||
m_TransformMetaInfo->GetTranslations(),
|
||||
m_TransformMetaInfo->GetRotations(),
|
||||
m_DRTImage2MetaInfo->GetProjectionOriginLPSZero(),
|
||||
m_DRTImage2MetaInfo->GetProjectionOriginLPS(),
|
||||
IECtoLPS_Directions
|
||||
);
|
||||
} else {
|
||||
|
||||
CurrTransform =
|
||||
CalculateInternalTransform(
|
||||
// CurrTransform =
|
||||
// CalculateInternalTransform(
|
||||
// ZeroPoint ,
|
||||
// m_DRTGeometryMetaInfo->GetIECS2IECScannerR(),
|
||||
// m_TransformMetaInfo->GetTranslations(),
|
||||
// m_TransformMetaInfo->GetRotations(),
|
||||
// m_DRTImage1MetaInfo->GetProjectionOriginLPS(),
|
||||
// m_RTMetaInfo->GetIsocenterLPS() - m_CTMetaInfo->GetImportOffset(),
|
||||
// m_CTMetaInfo->GetImportOffset(),
|
||||
// IECtoLPS_Directions
|
||||
// );
|
||||
|
||||
CurrTransform = CalculateInternalTransformV2(
|
||||
ZeroPoint ,
|
||||
m_DRTGeometryMetaInfo->GetIECS2IECScannerR(),
|
||||
m_TransformMetaInfo->GetTranslations(),
|
||||
m_TransformMetaInfo->GetRotations(),
|
||||
m_DRTImage1MetaInfo->GetProjectionOriginLPS(),
|
||||
m_RTMetaInfo->GetIsocenterLPS() - m_CTMetaInfo->GetImportOffset(),
|
||||
m_CTMetaInfo->GetImportOffset(),
|
||||
m_DRTImage1MetaInfo->GetProjectionOriginLPSZero(),
|
||||
m_RTMetaInfo->GetIsocenterLPS() - m_CTMetaInfo->GetOriginLPS(),
|
||||
IECtoLPS_Directions
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
|
||||
transform1->SetComputeZYX(true);
|
||||
transform1->SetIdentity();
|
||||
// transform1->SetComputeZYX(true);
|
||||
// transform1->SetIdentity();
|
||||
|
||||
transform1->SetTranslation(
|
||||
CurrTransform->GetTranslation());
|
||||
transform1->SetRotation(
|
||||
CurrTransform->GetAngleX(),
|
||||
CurrTransform->GetAngleY(),
|
||||
CurrTransform->GetAngleZ()
|
||||
);
|
||||
// transform1->SetTranslation(
|
||||
// CurrTransform->GetTranslation());
|
||||
// transform1->SetRotation(
|
||||
// CurrTransform->GetAngleX(),
|
||||
// CurrTransform->GetAngleY(),
|
||||
// CurrTransform->GetAngleZ()
|
||||
// );
|
||||
|
||||
|
||||
transform1->SetCenter(
|
||||
m_DRTImage1MetaInfo->GetProjectionOriginLPSZero() );
|
||||
// transform1->Print(std::cout);
|
||||
// transform1->SetCenter(
|
||||
// m_DRTImage1MetaInfo->GetProjectionOriginLPSZero() );
|
||||
|
||||
|
||||
transform1 = CurrTransform;
|
||||
|
||||
|
||||
// 2D Image 1
|
||||
interpolator1->SetProjectionAngle(
|
||||
@ -1920,48 +2051,70 @@ void itkImageProcessor::InitializeProjector()
|
||||
|
||||
|
||||
|
||||
CurrTransform =
|
||||
CalculateInternalTransform(
|
||||
ZeroPoint,
|
||||
ZeroPoint,
|
||||
m_TransformMetaInfo->GetTranslations(),
|
||||
m_TransformMetaInfo->GetRotations(),
|
||||
m_DRTImage2MetaInfo->GetProjectionOriginLPS(),
|
||||
pFakeIsoLPS,
|
||||
ZeroPoint,
|
||||
IECtoLPS_Directions
|
||||
);
|
||||
// CurrTransform =
|
||||
// CalculateInternalTransform(
|
||||
// ZeroPoint,
|
||||
// ZeroPoint,
|
||||
// m_TransformMetaInfo->GetTranslations(),
|
||||
// m_TransformMetaInfo->GetRotations(),
|
||||
// m_DRTImage2MetaInfo->GetProjectionOriginLPS(),
|
||||
// pFakeIsoLPS,
|
||||
// ZeroPoint,
|
||||
// IECtoLPS_Directions
|
||||
// );
|
||||
CurrTransform = CalculateInternalTransformV2(
|
||||
ZeroPoint ,
|
||||
ZeroPoint ,
|
||||
m_TransformMetaInfo->GetTranslations(),
|
||||
m_TransformMetaInfo->GetRotations(),
|
||||
m_DRTImage2MetaInfo->GetProjectionOriginLPSZero(),
|
||||
m_DRTImage2MetaInfo->GetProjectionOriginLPS(),
|
||||
IECtoLPS_Directions
|
||||
);
|
||||
} else {
|
||||
|
||||
CurrTransform =
|
||||
CalculateInternalTransform(
|
||||
// CurrTransform =
|
||||
// CalculateInternalTransform(
|
||||
// ZeroPoint ,
|
||||
// m_DRTGeometryMetaInfo->GetIECS2IECScannerR(),
|
||||
// m_TransformMetaInfo->GetTranslations(),
|
||||
// m_TransformMetaInfo->GetRotations(),
|
||||
// m_DRTImage2MetaInfo->GetProjectionOriginLPS(),
|
||||
// m_RTMetaInfo->GetIsocenterLPS() - m_CTMetaInfo->GetImportOffset(),
|
||||
// m_CTMetaInfo->GetImportOffset(),
|
||||
// IECtoLPS_Directions
|
||||
// );
|
||||
|
||||
CurrTransform = CalculateInternalTransformV2(
|
||||
ZeroPoint ,
|
||||
m_DRTGeometryMetaInfo->GetIECS2IECScannerR(),
|
||||
m_TransformMetaInfo->GetTranslations(),
|
||||
m_TransformMetaInfo->GetRotations(),
|
||||
m_DRTImage2MetaInfo->GetProjectionOriginLPS(),
|
||||
m_RTMetaInfo->GetIsocenterLPS() - m_CTMetaInfo->GetImportOffset(),
|
||||
m_CTMetaInfo->GetImportOffset(),
|
||||
m_DRTImage2MetaInfo->GetProjectionOriginLPSZero(),
|
||||
m_RTMetaInfo->GetIsocenterLPS() - m_CTMetaInfo->GetOriginLPS(),
|
||||
IECtoLPS_Directions
|
||||
);
|
||||
|
||||
}
|
||||
transform2 = CurrTransform;
|
||||
|
||||
// transform2->SetComputeZYX(true);
|
||||
// transform2->SetIdentity();
|
||||
|
||||
// transform2->SetTranslation(
|
||||
// CurrTransform->GetTranslation());
|
||||
// transform2->SetRotation(
|
||||
// CurrTransform->GetAngleX(),
|
||||
// CurrTransform->GetAngleY(),
|
||||
// CurrTransform->GetAngleZ()
|
||||
// );
|
||||
|
||||
|
||||
transform2->SetComputeZYX(true);
|
||||
transform2->SetIdentity();
|
||||
// transform2->SetCenter(
|
||||
// m_DRTImage2MetaInfo->GetProjectionOriginLPSZero() );
|
||||
// transform2 ->SetCenter(
|
||||
// m_CTMetaInfo->GetProjectionOriginLPSZero(
|
||||
// m_DRTGeometryMetaInfo->GetProjectionCenter()));
|
||||
|
||||
transform2->SetTranslation(
|
||||
CurrTransform->GetTranslation());
|
||||
transform2->SetRotation(
|
||||
CurrTransform->GetAngleX(),
|
||||
CurrTransform->GetAngleY(),
|
||||
CurrTransform->GetAngleZ()
|
||||
);
|
||||
|
||||
|
||||
transform2->SetCenter(
|
||||
m_DRTImage2MetaInfo->GetProjectionOriginLPSZero() );
|
||||
//transform2->Print(std::cout);
|
||||
|
||||
// 2D Image 2
|
||||
@ -2193,11 +2346,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;
|
||||
|
||||
@ -2208,7 +2361,7 @@ void itkImageProcessor::UpdateProjectionGeometryMeta(){
|
||||
CalibratedIsocenterLPS[2] = NominalIsocenter_wZcorrectionLPS[2] +
|
||||
IsocenterOffsetLPS[2];
|
||||
|
||||
std::cout<<"CALIBRATION CalibratedIsocenterLPS "<<CalibratedIsocenterLPS<<std::endl;
|
||||
//std::cout<<"CALIBRATION CalibratedIsocenterLPS "<<CalibratedIsocenterLPS<<std::endl;
|
||||
|
||||
ImageType3D::PointType CalibratedIsocenterZeroLPS;
|
||||
|
||||
@ -2218,7 +2371,7 @@ void itkImageProcessor::UpdateProjectionGeometryMeta(){
|
||||
IsocenterOffsetLPS[1];
|
||||
CalibratedIsocenterZeroLPS[2] = NominalIsocenterZero_wZcorrectionLPS[2] +
|
||||
IsocenterOffsetLPS[2];
|
||||
std::cout<<"CALIBRATION CalibratedIsocenterZeroLPS "<<CalibratedIsocenterZeroLPS<<std::endl;
|
||||
//std::cout<<"CALIBRATION CalibratedIsocenterZeroLPS "<<CalibratedIsocenterZeroLPS<<std::endl;
|
||||
|
||||
m_DRTImage1MetaInfo->SetProjectionAngleLPS(
|
||||
this->CalcProjectionAngleLPS(
|
||||
@ -2276,15 +2429,7 @@ 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;
|
||||
|
||||
@ -2540,51 +2685,79 @@ void itkImageProcessor::GetProjectionImages(){
|
||||
// std::cout<<"pFakeIsoLPS: "<<std::endl;
|
||||
|
||||
CurrTransform =
|
||||
CalculateInternalTransform(
|
||||
CalculateInternalTransformV2(
|
||||
ZeroPoint,
|
||||
ZeroPoint,
|
||||
m_TransformMetaInfo->GetTranslations(),
|
||||
m_TransformMetaInfo->GetRotations(),
|
||||
m_DRTImage1MetaInfo->GetProjectionOriginLPSZero(),
|
||||
m_DRTImage1MetaInfo->GetProjectionOriginLPS(),
|
||||
pFakeIsoLPS,
|
||||
ZeroPoint,
|
||||
IECtoLPS_Directions
|
||||
);
|
||||
} else {
|
||||
|
||||
CurrTransform =
|
||||
CalculateInternalTransform(
|
||||
ZeroPoint ,
|
||||
m_DRTGeometryMetaInfo->GetIECS2IECScannerR(),
|
||||
m_TransformMetaInfo->GetTranslations(),
|
||||
m_TransformMetaInfo->GetRotations(),
|
||||
m_DRTImage1MetaInfo->GetProjectionOriginLPS(),
|
||||
m_RTMetaInfo->GetIsocenterLPS() - m_CTMetaInfo->GetImportOffset(),
|
||||
m_CTMetaInfo->GetImportOffset(),
|
||||
IECtoLPS_Directions
|
||||
);
|
||||
|
||||
}
|
||||
// CurrTransform =
|
||||
// CalculateInternalTransform(
|
||||
// ZeroPoint ,
|
||||
// m_DRTGeometryMetaInfo->GetIECS2IECScannerR(),
|
||||
// m_TransformMetaInfo->GetTranslations(),
|
||||
// m_TransformMetaInfo->GetRotations(),
|
||||
// m_DRTImage1MetaInfo->GetProjectionOriginLPS(),
|
||||
// m_RTMetaInfo->GetIsocenterLPS() - m_CTMetaInfo->GetImportOffset(),
|
||||
// m_CTMetaInfo->GetImportOffset(),
|
||||
// IECtoLPS_Directions
|
||||
// );
|
||||
|
||||
std::cout<<"Curr GetCenter"<<CurrTransform->GetCenter()<<std::endl;
|
||||
if(m_RTMetaInfo != NULL) std::cout<<"IsoCenter"<<m_RTMetaInfo->GetIsocenterLPS()<<std::endl;
|
||||
CurrTransform = CalculateInternalTransformV2(
|
||||
ZeroPoint ,
|
||||
m_DRTGeometryMetaInfo->GetIECS2IECScannerR(),
|
||||
m_TransformMetaInfo->GetTranslations(),
|
||||
m_TransformMetaInfo->GetRotations(),
|
||||
m_DRTImage1MetaInfo->GetProjectionOriginLPSZero(),
|
||||
m_RTMetaInfo->GetIsocenterLPS() - m_CTMetaInfo->GetOriginLPS(),
|
||||
IECtoLPS_Directions
|
||||
);
|
||||
|
||||
transform1->SetComputeZYX(true);
|
||||
transform1->SetIdentity();
|
||||
std::cout<<m_DRTImage1MetaInfo->GetProjectionOriginLPSZero()<<std::endl;
|
||||
std::cout<<m_RTMetaInfo->GetIsocenterLPS() <<std::endl;
|
||||
std::cout<<m_CTMetaInfo->GetOriginLPS() <<std::endl;
|
||||
std::cout<<m_RTMetaInfo->GetIsocenterLPS() - m_CTMetaInfo->GetOriginLPS() <<std::endl;
|
||||
|
||||
transform1->SetTranslation(
|
||||
CurrTransform->GetTranslation());
|
||||
transform1->SetRotation(
|
||||
CurrTransform->GetAngleX(),
|
||||
CurrTransform->GetAngleY(),
|
||||
CurrTransform->GetAngleZ()
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// transform1->SetComputeZYX(true);
|
||||
// transform1->SetIdentity();
|
||||
|
||||
// transform1->SetTranslation(
|
||||
// CurrTransform->GetTranslation());
|
||||
// transform1->SetRotation(
|
||||
// CurrTransform->GetAngleX(),
|
||||
// CurrTransform->GetAngleY(),
|
||||
// CurrTransform->GetAngleZ()
|
||||
// );
|
||||
|
||||
|
||||
// transform1->SetCenter(
|
||||
// m_DRTImage1MetaInfo->GetProjectionOriginLPSZero() );
|
||||
|
||||
|
||||
transform1 = CurrTransform;
|
||||
|
||||
// std::cout<< "itkImageProcessor::GetProjectionImages" <<std::endl;
|
||||
|
||||
// AAAAAAA TODOOO CERCAA
|
||||
transform1 ->SetCenter(
|
||||
m_DRTImage1MetaInfo->GetProjectionOriginLPSZero());
|
||||
// transform1 ->SetCenter(
|
||||
// m_DRTImage1MetaInfo->GetProjectionOriginLPSZero());
|
||||
// transform1 ->SetCenter(
|
||||
// m_CTMetaInfo->GetProjectionOriginLPSZero(
|
||||
// m_DRTGeometryMetaInfo->GetProjectionCenter()));
|
||||
|
||||
|
||||
std::cout<<"----> transform1 GetCenter"<<transform1->GetCenter()<<std::endl;
|
||||
|
||||
// std::cout<<"Angle1 "<<m_DRTImage1MetaInfo->GetProjectionAngleLPS() <<std::endl;
|
||||
// std::cout<< "Origin1LPSZERO: "<<
|
||||
@ -2624,14 +2797,14 @@ void itkImageProcessor::GetProjectionImages(){
|
||||
// std::cout<<"pFakeIsoLPS: "<<std::endl;
|
||||
|
||||
CurrTransform =
|
||||
CalculateInternalTransform(
|
||||
CalculateInternalTransformV2(
|
||||
ZeroPoint,
|
||||
ZeroPoint,
|
||||
m_TransformMetaInfo->GetTranslations(),
|
||||
m_TransformMetaInfo->GetRotations(),
|
||||
m_DRTImage2MetaInfo->GetProjectionOriginLPSZero(),
|
||||
m_DRTImage2MetaInfo->GetProjectionOriginLPS(),
|
||||
pFakeIsoLPS,
|
||||
ZeroPoint,
|
||||
|
||||
IECtoLPS_Directions
|
||||
);
|
||||
|
||||
@ -2639,37 +2812,48 @@ void itkImageProcessor::GetProjectionImages(){
|
||||
|
||||
} else {
|
||||
|
||||
CurrTransform =
|
||||
CalculateInternalTransform(
|
||||
// CurrTransform =
|
||||
// CalculateInternalTransform(
|
||||
// ZeroPoint ,
|
||||
// m_DRTGeometryMetaInfo->GetIECS2IECScannerR(),
|
||||
// m_TransformMetaInfo->GetTranslations(),
|
||||
// m_TransformMetaInfo->GetRotations(),
|
||||
// m_DRTImage2MetaInfo->GetProjectionOriginLPS(),
|
||||
// m_RTMetaInfo->GetIsocenterLPS() - m_CTMetaInfo->GetImportOffset(),
|
||||
// m_CTMetaInfo->GetImportOffset(),
|
||||
// IECtoLPS_Directions
|
||||
// );
|
||||
|
||||
CurrTransform = CalculateInternalTransformV2(
|
||||
ZeroPoint ,
|
||||
m_DRTGeometryMetaInfo->GetIECS2IECScannerR(),
|
||||
m_TransformMetaInfo->GetTranslations(),
|
||||
m_TransformMetaInfo->GetRotations(),
|
||||
m_DRTImage2MetaInfo->GetProjectionOriginLPS(),
|
||||
m_RTMetaInfo->GetIsocenterLPS() - m_CTMetaInfo->GetImportOffset(),
|
||||
m_CTMetaInfo->GetImportOffset(),
|
||||
m_DRTImage2MetaInfo->GetProjectionOriginLPSZero(),
|
||||
m_RTMetaInfo->GetIsocenterLPS() - m_CTMetaInfo->GetOriginLPS(),
|
||||
IECtoLPS_Directions
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
transform2 = CurrTransform;
|
||||
|
||||
// transform2->SetComputeZYX(true);
|
||||
// transform2->SetIdentity();
|
||||
|
||||
// transform2->SetTranslation(
|
||||
// CurrTransform->GetTranslation());
|
||||
// transform2->SetRotation(
|
||||
// CurrTransform->GetAngleX(),
|
||||
// CurrTransform->GetAngleY(),
|
||||
// CurrTransform->GetAngleZ()
|
||||
// );
|
||||
|
||||
|
||||
transform2->SetComputeZYX(true);
|
||||
transform2->SetIdentity();
|
||||
|
||||
transform2->SetTranslation(
|
||||
CurrTransform->GetTranslation());
|
||||
transform2->SetRotation(
|
||||
CurrTransform->GetAngleX(),
|
||||
CurrTransform->GetAngleY(),
|
||||
CurrTransform->GetAngleZ()
|
||||
);
|
||||
|
||||
|
||||
transform2 ->SetCenter(
|
||||
m_DRTImage2MetaInfo->GetProjectionOriginLPSZero());
|
||||
|
||||
// transform2 ->SetCenter(
|
||||
// m_DRTImage2MetaInfo->GetProjectionOriginLPSZero());
|
||||
// transform2 ->SetCenter(
|
||||
// m_CTMetaInfo->GetProjectionOriginLPSZero(
|
||||
// m_DRTGeometryMetaInfo->GetProjectionCenter()));
|
||||
|
||||
//transform2 ->Print(std::cout);
|
||||
|
||||
|
@ -280,6 +280,17 @@ private:
|
||||
InternalImageType::DirectionType m_IECtoLPSDirections
|
||||
);
|
||||
|
||||
TransformType::Pointer
|
||||
CalculateInternalTransformV2(
|
||||
ImageType3D::PointType m_TranslationOffset,
|
||||
ImageType3D::PointType m_RotationOffset,
|
||||
ImageType3D::PointType m_TranslationUser,
|
||||
ImageType3D::PointType m_RotationUser,
|
||||
ImageType3D::PointType m_CalibratedProjectionCenter,
|
||||
ImageType3D::PointType m_RTIsocenter,
|
||||
InternalImageType::DirectionType m_IECtoLPSDirections
|
||||
);
|
||||
|
||||
|
||||
TransformType::Pointer
|
||||
transform1,
|
||||
|
Reference in New Issue
Block a user