Cleanup debug print
This commit is contained in:
@ -1414,79 +1414,6 @@ itkImageProcessor::CalculateInternalTransformV2(
|
||||
}
|
||||
|
||||
|
||||
|
||||
//itkImageProcessor::TransformType::Pointer
|
||||
//itkImageProcessor::CalculateInternalTransform(
|
||||
// ImageType3D::PointType m_TranslationOffset, //IEC
|
||||
// ImageType3D::PointType m_RotationOffset, //IEC
|
||||
// ImageType3D::PointType m_TranslationUser, //IEC
|
||||
// ImageType3D::PointType m_RotationUser, //IEC
|
||||
// ImageType3D::PointType m_ProjectionTransformCenter, //LPS
|
||||
// ImageType3D::PointType m_UserTransformCenter, //LPS
|
||||
// ImageType3D::PointType m_OffsetTransformCenter, //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;
|
||||
|
||||
// // Map user to the projection center
|
||||
// TransformType::Pointer m_UserTransform =
|
||||
// MapTransformToNewOrigin (
|
||||
// m_ProjectionTransformCenter - m_UserTransformCenter,
|
||||
// m_TUserLPS,
|
||||
// m_RUserLPS
|
||||
// );
|
||||
|
||||
// // Map offset to the projection center
|
||||
// TransformType::Pointer m_OffsetTransform =
|
||||
// MapTransformToNewOrigin (
|
||||
// m_ProjectionTransformCenter - m_UserTransformCenter,//m_OffsetTransformCenter,
|
||||
// m_TOffsetLPS,
|
||||
// m_ROffsetLPS
|
||||
// );
|
||||
|
||||
// TransformType::Pointer m_OutputTransform =
|
||||
// TransformType::New();
|
||||
// m_OutputTransform ->SetComputeZYX(true);
|
||||
// m_OutputTransform ->SetIdentity();
|
||||
|
||||
// m_OutputTransform->SetTranslation(
|
||||
// m_OffsetTransform->GetTranslation() +
|
||||
// m_UserTransform->GetTranslation()
|
||||
// );
|
||||
|
||||
// m_OutputTransform->SetRotation(
|
||||
// m_OffsetTransform->GetAngleX() +
|
||||
// m_UserTransform->GetAngleX(),
|
||||
// m_OffsetTransform->GetAngleY() +
|
||||
// m_UserTransform->GetAngleY(),
|
||||
// m_OffsetTransform->GetAngleZ() +
|
||||
// m_UserTransform->GetAngleZ()
|
||||
// );
|
||||
|
||||
// m_OutputTransform->SetCenter(
|
||||
// m_ProjectionTransformCenter);
|
||||
|
||||
|
||||
// std::cout<<m_OutputTransform<<std::endl;
|
||||
|
||||
// return
|
||||
// m_OutputTransform;
|
||||
//}
|
||||
|
||||
void itkImageProcessor::InitializeRegistration(
|
||||
double stepLength,
|
||||
double maxTranslation,
|
||||
@ -1572,20 +1499,7 @@ void itkImageProcessor::InitializeRegistration(
|
||||
//AAAAAA TODOOOOO CERCA
|
||||
ImageType3D::PointType pFakeIsoLPS =
|
||||
m_DRTImage1MetaInfo->GetProjectionOriginLPS();
|
||||
//ImageType3D::PointType pFakeIsoLPS =
|
||||
// m_CTMetaInfo->GetProjectionOriginLPS(
|
||||
// m_DRTGeometryMetaInfo->GetProjectionCenter1());
|
||||
// CurrTransform =
|
||||
// CalculateInternalTransform(
|
||||
// ZeroPoint,
|
||||
// ZeroPoint,
|
||||
// m_TransformMetaInfo->GetTranslations(),
|
||||
// m_TransformMetaInfo->GetRotations(),
|
||||
// m_DRTImage1MetaInfo->GetProjectionOriginLPS(),
|
||||
// pFakeIsoLPS,
|
||||
// ZeroPoint,
|
||||
// IECtoLPS_Directions
|
||||
// );
|
||||
|
||||
CurrTransform =
|
||||
CalculateInternalTransformV2(
|
||||
ZeroPoint,
|
||||
@ -1599,17 +1513,6 @@ void itkImageProcessor::InitializeRegistration(
|
||||
|
||||
} 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 = CalculateInternalTransformV2(
|
||||
ZeroPoint ,
|
||||
m_DRTGeometryMetaInfo->GetIECS2IECScannerR(),
|
||||
@ -1620,7 +1523,6 @@ void itkImageProcessor::InitializeRegistration(
|
||||
IECtoLPS_Directions
|
||||
);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -1635,6 +1537,7 @@ void itkImageProcessor::InitializeRegistration(
|
||||
);
|
||||
transform1->SetCenter(
|
||||
m_DRTImage1MetaInfo->GetProjectionOriginLPSZero() );
|
||||
|
||||
/********* END OF CALCULATE INTERNAL TRANSFORM FOR PROJ1 *********/
|
||||
|
||||
|
||||
@ -1645,24 +1548,7 @@ void itkImageProcessor::InitializeRegistration(
|
||||
ImageType3D::PointType pFakeIsoLPS =
|
||||
m_DRTImage2MetaInfo->GetProjectionOriginLPS();
|
||||
|
||||
//ImageType3D::PointType pFakeIsoLPS =
|
||||
// m_CTMetaInfo->GetProjectionOriginLPS(
|
||||
// m_DRTGeometryMetaInfo->GetProjectionCenter2());
|
||||
|
||||
|
||||
|
||||
// CurrTransform =
|
||||
// CalculateInternalTransform(
|
||||
// ZeroPoint,
|
||||
// ZeroPoint,
|
||||
// m_TransformMetaInfo->GetTranslations(),
|
||||
// m_TransformMetaInfo->GetRotations(),
|
||||
// m_DRTImage2MetaInfo->GetProjectionOriginLPS(),
|
||||
// pFakeIsoLPS,
|
||||
// ZeroPoint,
|
||||
// IECtoLPS_Directions
|
||||
// );
|
||||
CurrTransform =
|
||||
CurrTransform =
|
||||
CalculateInternalTransformV2(
|
||||
ZeroPoint,
|
||||
ZeroPoint,
|
||||
@ -1675,17 +1561,7 @@ void itkImageProcessor::InitializeRegistration(
|
||||
|
||||
} else {
|
||||
|
||||
// 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(),
|
||||
@ -1923,32 +1799,10 @@ void itkImageProcessor::InitializeProjector()
|
||||
m_CTMetaInfo->GetLPS2IECDirections().GetTranspose();
|
||||
|
||||
TransformType::Pointer CurrTransform;
|
||||
//CurrTransform->SetComputeZYX(true);
|
||||
//CurrTransform->SetIdentity();
|
||||
|
||||
if(m_RTMetaInfo == NULL)
|
||||
{
|
||||
|
||||
//AAAAAA TODOOOOO CERCA
|
||||
ImageType3D::PointType pFakeIsoLPS =
|
||||
m_DRTImage1MetaInfo->GetProjectionOriginLPS();
|
||||
|
||||
//ImageType3D::PointType pFakeIsoLPS =
|
||||
// m_CTMetaInfo->GetProjectionOriginLPS(
|
||||
// m_DRTGeometryMetaInfo->GetProjectionCenter1());
|
||||
|
||||
|
||||
// CurrTransform =
|
||||
// CalculateInternalTransform(
|
||||
// ZeroPoint,
|
||||
// ZeroPoint,
|
||||
// m_TransformMetaInfo->GetTranslations(),
|
||||
// m_TransformMetaInfo->GetRotations(),
|
||||
// m_DRTImage1MetaInfo->GetProjectionOriginLPS(),
|
||||
// pFakeIsoLPS,
|
||||
// ZeroPoint,
|
||||
// IECtoLPS_Directions
|
||||
// );
|
||||
CurrTransform = CalculateInternalTransformV2(
|
||||
ZeroPoint ,
|
||||
ZeroPoint ,
|
||||
@ -1959,20 +1813,8 @@ void itkImageProcessor::InitializeProjector()
|
||||
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 = CalculateInternalTransformV2(
|
||||
ZeroPoint ,
|
||||
@ -1999,10 +1841,9 @@ void itkImageProcessor::InitializeProjector()
|
||||
CurrTransform->GetAngleZ()
|
||||
);
|
||||
|
||||
|
||||
transform1->SetCenter(
|
||||
m_DRTImage1MetaInfo->GetProjectionOriginLPSZero() );
|
||||
// transform1->Print(std::cout);
|
||||
|
||||
|
||||
// 2D Image 1
|
||||
interpolator1->SetProjectionAngle(
|
||||
@ -2013,40 +1854,13 @@ void itkImageProcessor::InitializeProjector()
|
||||
m_DRTGeometryMetaInfo->GetIntensityThreshold() );
|
||||
interpolator1->SetPanelOffset(
|
||||
m_DRTGeometryMetaInfo->GetPanel1Offset());
|
||||
std::cout<<
|
||||
"00000000000000 IP1 m_DRTGeometryMetaInfo->GetPanel2Offset()"
|
||||
<<m_DRTGeometryMetaInfo->GetPanel1Offset()<<std::endl;
|
||||
|
||||
interpolator1->SetTransform(transform1);
|
||||
interpolator1->Initialize();
|
||||
|
||||
|
||||
|
||||
//CurrTransform->SetComputeZYX(true);
|
||||
//CurrTransform->SetIdentity();
|
||||
|
||||
if(m_RTMetaInfo == NULL)
|
||||
{
|
||||
ImageType3D::PointType pFakeIsoLPS =
|
||||
m_DRTImage2MetaInfo->GetProjectionOriginLPS();
|
||||
|
||||
//ImageType3D::PointType pFakeIsoLPS =
|
||||
// m_CTMetaInfo->GetProjectionOriginLPS(
|
||||
// m_DRTGeometryMetaInfo->GetProjectionCenter2());
|
||||
|
||||
|
||||
|
||||
// CurrTransform =
|
||||
// CalculateInternalTransform(
|
||||
// ZeroPoint,
|
||||
// ZeroPoint,
|
||||
// m_TransformMetaInfo->GetTranslations(),
|
||||
// m_TransformMetaInfo->GetRotations(),
|
||||
// m_DRTImage2MetaInfo->GetProjectionOriginLPS(),
|
||||
// pFakeIsoLPS,
|
||||
// ZeroPoint,
|
||||
// IECtoLPS_Directions
|
||||
// );
|
||||
CurrTransform =
|
||||
CalculateInternalTransformV2(
|
||||
ZeroPoint,
|
||||
@ -2061,17 +1875,6 @@ void itkImageProcessor::InitializeProjector()
|
||||
|
||||
} else {
|
||||
|
||||
// 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(),
|
||||
@ -2081,8 +1884,6 @@ void itkImageProcessor::InitializeProjector()
|
||||
m_RTMetaInfo->GetIsocenterLPS() - m_CTMetaInfo->GetOriginLPS(),
|
||||
IECtoLPS_Directions
|
||||
);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -2111,25 +1912,10 @@ void itkImageProcessor::InitializeProjector()
|
||||
m_DRTGeometryMetaInfo->GetIntensityThreshold() );
|
||||
interpolator2->SetPanelOffset(
|
||||
m_DRTGeometryMetaInfo->GetPanel2Offset());
|
||||
std::cout<<
|
||||
"00000000000000 IP2 m_DRTGeometryMetaInfo->GetPanel2Offset()"
|
||||
<<m_DRTGeometryMetaInfo->GetPanel2Offset()<<std::endl;
|
||||
|
||||
interpolator2->SetTransform(transform2);
|
||||
interpolator2->Initialize();
|
||||
|
||||
// // 2D Image 2
|
||||
// interpolator2->SetProjectionAngle(
|
||||
// dtr *
|
||||
// m_DRTImage2MetaInfo->GetProjectionAngleLPS() );
|
||||
// interpolator2->SetFocalPointToIsocenterDistance(
|
||||
// m_DRTImage2MetaInfo->GetSCD());
|
||||
// interpolator2->SetThreshold(
|
||||
// m_DRTGeometryMetaInfo->GetIntensityThreshold()
|
||||
// );
|
||||
// interpolator2->SetTransform(transform);
|
||||
// interpolator2->Initialize();
|
||||
|
||||
|
||||
resampleFilter1 = ResampleFilterType::New();
|
||||
resampleFilter1->SetInput(
|
||||
@ -2282,9 +2068,6 @@ void itkImageProcessor::loadRTPlanInfo(
|
||||
);
|
||||
|
||||
|
||||
// std::cout<< "m_CTMetaInfo->GetImportOffset() "
|
||||
// <<m_CTMetaInfo->GetImportOffset() <<std::endl;
|
||||
|
||||
this->UpdateProjectionGeometryMeta();
|
||||
this->InitializeProjector();
|
||||
|
||||
@ -2331,11 +2114,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;
|
||||
|
||||
@ -2346,7 +2129,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;
|
||||
|
||||
@ -2356,7 +2139,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(
|
||||
@ -2376,20 +2159,6 @@ 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()
|
||||
// );
|
||||
|
||||
// std::cout<<"Bounds1: "
|
||||
// <<vBounds.data()[0]<<" "
|
||||
// <<vBounds.data()[1]<<" "
|
||||
// <<vBounds.data()[2]<<" "
|
||||
// <<vBounds.data()[3]<<" "
|
||||
// <<vBounds.data()[4]<<" "
|
||||
// <<vBounds.data()[5]<<std::endl;
|
||||
|
||||
m_DRTImage1MetaInfo->SetSizeWithBounds(
|
||||
NULL,//vBounds.data(),
|
||||
m_DRTGeometryMetaInfo->GetDRT1Size(),
|
||||
@ -2414,19 +2183,9 @@ 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;
|
||||
|
||||
|
||||
|
||||
m_DRTImage1MetaInfo->SetImageDirectionsLPS(
|
||||
CalcDRTImageDirections(
|
||||
@ -2437,24 +2196,6 @@ void itkImageProcessor::UpdateProjectionGeometryMeta(){
|
||||
Std_DRT2LPS)
|
||||
);
|
||||
|
||||
// std::cout<<"IsocenterOffsetLPS"<< IsocenterOffsetLPS <<std::endl;
|
||||
// std::cout<<"CalibratedIsocenterLPS"<< CalibratedIsocenterLPS <<std::endl;
|
||||
// std::cout<<"CalibratedIsocenterZeroLPS"<< CalibratedIsocenterZeroLPS <<std::endl;
|
||||
// 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->GetProjectionAngleLPS()"<<m_DRTImage1MetaInfo->GetProjectionAngleLPS()<<std::endl;
|
||||
// std::cout<<"m_DRTImage1MetaInfo->GetImageDirectionsLPS()"<< m_DRTImage1MetaInfo->GetImageDirectionsLPS() <<std::endl;
|
||||
|
||||
// SECOND
|
||||
|
||||
|
||||
@ -2492,28 +2233,10 @@ void itkImageProcessor::UpdateProjectionGeometryMeta(){
|
||||
|
||||
m_DRTImage2MetaInfo->SetProjectionOriginLPS(
|
||||
CalibratedIsocenterLPS);
|
||||
// m_CTMetaInfo->GetProjectionOriginLPS(
|
||||
// m_DRTGeometryMetaInfo->GetProjectionCenter2())
|
||||
// );
|
||||
|
||||
m_DRTImage2MetaInfo->SetProjectionOriginLPSZero(
|
||||
CalibratedIsocenterZeroLPS);
|
||||
// m_CTMetaInfo->GetProjectionOriginLPSZero(
|
||||
// m_DRTGeometryMetaInfo->GetProjectionCenter2())
|
||||
// );
|
||||
|
||||
// vBounds.clear();
|
||||
// vBounds = m_CTMetaInfo->CalculateRegions(
|
||||
// NominalIsocenter_wZcorrectionLPS//m_DRTImage2MetaInfo->GetProjectionOriginLPS()
|
||||
// );
|
||||
|
||||
// std::cout<<"Bounds2: "
|
||||
// <<vBounds.data()[0]<<" "
|
||||
// <<vBounds.data()[1]<<" "
|
||||
// <<vBounds.data()[2]<<" "
|
||||
// <<vBounds.data()[3]<<" "
|
||||
// <<vBounds.data()[4]<<" "
|
||||
// <<vBounds.data()[5]<<std::endl;
|
||||
|
||||
m_DRTImage2MetaInfo->SetSizeWithBounds(
|
||||
NULL,//vBounds.data(),
|
||||
@ -2541,8 +2264,6 @@ void itkImageProcessor::UpdateProjectionGeometryMeta(){
|
||||
Std_DRT2LPS
|
||||
));
|
||||
|
||||
std::cout<<"m_DRTImage2MetaInfo->GetOriginLPS()"<< m_DRTImage2MetaInfo->GetOriginLPS() <<std::endl;
|
||||
|
||||
|
||||
m_DRTImage2MetaInfo->SetOriginLPS(
|
||||
CalcDRTImageOrigin(
|
||||
@ -2554,14 +2275,7 @@ void itkImageProcessor::UpdateProjectionGeometryMeta(){
|
||||
m_DRTGeometryMetaInfo->GetProjectionAngle2IEC()) ,
|
||||
//m_DRTGeometryMetaInfo->GetProjectionAngle2IEC(),//m_DRTImage2MetaInfo->GetProjectionAngleLPS(),
|
||||
Std_DRT2LPS
|
||||
) /*-
|
||||
CalcDRTImageOffset(
|
||||
PanelOffsetIEC2,
|
||||
this->CalcProjectionAngleLPS(
|
||||
m_CTMetaInfo->GetPatientOrientation(),
|
||||
m_DRTGeometryMetaInfo->GetProjectionAngle2IEC() ),
|
||||
Std_DRT2LPS
|
||||
)*/
|
||||
)
|
||||
|
||||
);
|
||||
|
||||
@ -2574,26 +2288,6 @@ void itkImageProcessor::UpdateProjectionGeometryMeta(){
|
||||
Std_DRT2LPS)
|
||||
);
|
||||
|
||||
// std::cout<<"IsocenterOffsetLPS"<< IsocenterOffsetLPS <<std::endl;
|
||||
// std::cout<<"CalibratedIsocenterLPS"<< CalibratedIsocenterLPS <<std::endl;
|
||||
// std::cout<<"CalibratedIsocenterZeroLPS"<< CalibratedIsocenterZeroLPS <<std::endl;
|
||||
// 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() - 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;
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -2622,22 +2316,6 @@ 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(){
|
||||
@ -2664,31 +2342,10 @@ void itkImageProcessor::GetProjectionImages(){
|
||||
IECtoLPS_Directions =
|
||||
m_CTMetaInfo->GetLPS2IECDirections().GetTranspose();
|
||||
TransformType::Pointer CurrTransform;
|
||||
//CurrTransform->SetComputeZYX(true);
|
||||
//CurrTransform->SetIdentity();
|
||||
|
||||
|
||||
if(m_RTMetaInfo == NULL)
|
||||
{
|
||||
|
||||
ImageType3D::PointType pFakeIsoLPS =
|
||||
m_DRTImage1MetaInfo->GetProjectionOriginLPS();
|
||||
//m_CTMetaInfo->GetProjectionOriginLPS(
|
||||
// m_DRTGeometryMetaInfo->GetProjectionCenter());
|
||||
|
||||
// std::cout<<"pFakeIsoLPS: "<<std::endl;
|
||||
|
||||
// CurrTransform =
|
||||
// CalculateInternalTransform(
|
||||
// ZeroPoint,
|
||||
// ZeroPoint,
|
||||
// m_TransformMetaInfo->GetTranslations(),
|
||||
// m_TransformMetaInfo->GetRotations(),
|
||||
// m_DRTImage1MetaInfo->GetProjectionOriginLPS(),
|
||||
// pFakeIsoLPS,
|
||||
// ZeroPoint,
|
||||
// IECtoLPS_Directions
|
||||
// );
|
||||
|
||||
CurrTransform =
|
||||
CalculateInternalTransformV2(
|
||||
ZeroPoint,
|
||||
@ -2702,18 +2359,6 @@ void itkImageProcessor::GetProjectionImages(){
|
||||
|
||||
} 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 = CalculateInternalTransformV2(
|
||||
ZeroPoint ,
|
||||
m_DRTGeometryMetaInfo->GetIECS2IECScannerR(),
|
||||
@ -2726,8 +2371,6 @@ void itkImageProcessor::GetProjectionImages(){
|
||||
|
||||
}
|
||||
|
||||
std::cout<<"Curr GetCenter"<<CurrTransform->GetCenter()<<std::endl;
|
||||
if(m_RTMetaInfo != NULL) std::cout<<"IsoCenter"<<m_RTMetaInfo->GetIsocenterLPS()<<std::endl;
|
||||
|
||||
transform1->SetComputeZYX(true);
|
||||
transform1->SetIdentity();
|
||||
@ -2739,22 +2382,9 @@ void itkImageProcessor::GetProjectionImages(){
|
||||
CurrTransform->GetAngleY(),
|
||||
CurrTransform->GetAngleZ()
|
||||
);
|
||||
|
||||
// std::cout<< "itkImageProcessor::GetProjectionImages" <<std::endl;
|
||||
|
||||
// AAAAAAA TODOOO CERCAA
|
||||
transform1 ->SetCenter(
|
||||
m_DRTImage1MetaInfo->GetProjectionOriginLPSZero());
|
||||
|
||||
// std::cout<<"Angle1 "<<m_DRTImage1MetaInfo->GetProjectionAngleLPS() <<std::endl;
|
||||
// std::cout<< "Origin1LPSZERO: "<<
|
||||
// m_DRTImage1MetaInfo->GetProjectionOriginLPSZero() <<std::endl;
|
||||
// std::cout<<"Origin1LPS: "<< m_DRTImage1MetaInfo->GetProjectionOriginLPS()<<std::endl;
|
||||
// std::cout<<"Angle2 "<<m_DRTImage2MetaInfo->GetProjectionAngleLPS() <<std::endl;
|
||||
// std::cout<< "Origin2LPSZERO: "<<
|
||||
// m_DRTImage2MetaInfo->GetProjectionOriginLPSZero() <<std::endl;
|
||||
// std::cout<<"Origin2LPS: "<< m_DRTImage2MetaInfo->GetProjectionOriginLPS()<<std::endl;
|
||||
|
||||
|
||||
//transform1 ->Print(std::cout);
|
||||
// The parameters of interpolator1, such as ProjectionAngle and FocalPointToIsocenterDistance
|
||||
@ -2764,36 +2394,13 @@ void itkImageProcessor::GetProjectionImages(){
|
||||
interpolator1->Initialize();
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
transform2->SetComputeZYX(true);
|
||||
transform2->SetIdentity();
|
||||
|
||||
//CurrTransform->SetComputeZYX(true);
|
||||
//CurrTransform->SetIdentity();
|
||||
|
||||
if(m_RTMetaInfo == NULL)
|
||||
{
|
||||
|
||||
ImageType3D::PointType pFakeIsoLPS =
|
||||
m_DRTImage2MetaInfo->GetProjectionOriginLPS();
|
||||
//m_CTMetaInfo->GetProjectionOriginLPS(
|
||||
// m_DRTGeometryMetaInfo->GetProjectionCenter());
|
||||
|
||||
// std::cout<<"pFakeIsoLPS: "<<std::endl;
|
||||
|
||||
// CurrTransform =
|
||||
// CalculateInternalTransform(
|
||||
// ZeroPoint,
|
||||
// ZeroPoint,
|
||||
// m_TransformMetaInfo->GetTranslations(),
|
||||
// m_TransformMetaInfo->GetRotations(),
|
||||
// m_DRTImage2MetaInfo->GetProjectionOriginLPS(),
|
||||
// pFakeIsoLPS,
|
||||
// ZeroPoint,
|
||||
// IECtoLPS_Directions
|
||||
// );
|
||||
CurrTransform =
|
||||
CalculateInternalTransformV2(
|
||||
ZeroPoint,
|
||||
@ -2805,22 +2412,8 @@ void itkImageProcessor::GetProjectionImages(){
|
||||
IECtoLPS_Directions
|
||||
);
|
||||
|
||||
// std::cout<<"pFakeIsoLPS: "<<std::endl;
|
||||
|
||||
} else {
|
||||
|
||||
// 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(),
|
||||
@ -2847,34 +2440,21 @@ void itkImageProcessor::GetProjectionImages(){
|
||||
CurrTransform->GetAngleZ()
|
||||
);
|
||||
|
||||
|
||||
transform2 ->SetCenter(
|
||||
m_DRTImage2MetaInfo->GetProjectionOriginLPSZero());
|
||||
|
||||
|
||||
//transform2 ->Print(std::cout);
|
||||
|
||||
|
||||
|
||||
// // The parameters of interpolator2, such as ProjectionAngle and FocalPointToIsocenterDistance
|
||||
// // have been set before registration. Here we only need to replace the initial
|
||||
// // transform with the final transform.
|
||||
interpolator2->SetTransform(transform2); //finalTransform);
|
||||
interpolator2->Initialize();
|
||||
|
||||
// std::cout<<"pFakeIsoLPS: "<<std::endl;
|
||||
|
||||
filter1->Update();
|
||||
filter2->Update();
|
||||
|
||||
imageDRT1In = filter1->GetOutput();
|
||||
imageDRT2In = filter2->GetOutput();
|
||||
// std::cout<< "itkImageProcessor::GetProjectionImages END" <<std::endl;
|
||||
|
||||
// std::cout<<"MMMMM: "<<
|
||||
// interpolator1->GetInverseTransform()->GetMatrix()<<std::endl;
|
||||
// std::cout<<"MMMMM: "<<
|
||||
// interpolator1->GetInverseTransform()->GetTranslation()<<std::endl;
|
||||
|
||||
}
|
||||
|
||||
@ -3290,13 +2870,12 @@ vtkImageData* itkImageProcessor::GetProjection2VTK()
|
||||
|
||||
|
||||
|
||||
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;
|
||||
//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;
|
||||
|
||||
return
|
||||
toVTK2D2->GetOutput();
|
||||
|
@ -97,7 +97,7 @@ public:
|
||||
Execute(const itk::Object* object, const itk::EventObject& event) override
|
||||
{
|
||||
if(objIterUpdate->getAbortFlag()){
|
||||
std::cout << "Abortisci per piacere" << std::endl;
|
||||
std::cout << "AbortRequest" << std::endl;
|
||||
objIterUpdate->setAbortFlag(false);
|
||||
throw itk::ProcessAborted();
|
||||
}
|
||||
|
Reference in New Issue
Block a user