|
|
|
@ -1968,44 +1968,45 @@ vtkImageData* itkImageProcessor::GetLocalizer1VTK()
|
|
|
|
|
toVTKLocalizer1->SetInput(rescaler1->GetOutput());
|
|
|
|
|
toVTKLocalizer1->Update();
|
|
|
|
|
|
|
|
|
|
if(false) {
|
|
|
|
|
using ImageRegionType3D = ImageType3D::RegionType;
|
|
|
|
|
using SizeType3D = ImageRegionType3D::SizeType;
|
|
|
|
|
using ImageDirectionType3D = ImageType3D::DirectionType;
|
|
|
|
|
// if(false) {
|
|
|
|
|
//// using ImageRegionType3D = ImageType3D::RegionType;
|
|
|
|
|
//// using SizeType3D = ImageRegionType3D::SizeType;
|
|
|
|
|
//// using ImageDirectionType3D = ImageType3D::DirectionType;
|
|
|
|
|
|
|
|
|
|
ImageRegionType3D region3D = rescaler1->GetOutput()->GetBufferedRegion();
|
|
|
|
|
SizeType3D size3D = region3D.GetSize();
|
|
|
|
|
ImageType3D::PointType origin3D = rescaler1->GetOutput()->GetOrigin();
|
|
|
|
|
const itk::Vector<double, 3> resolution3D = rescaler1->GetOutput()->GetSpacing();
|
|
|
|
|
ImageDirectionType3D imagDirection = rescaler1->GetOutput()->GetDirection();
|
|
|
|
|
//// ImageRegionType3D region3D = rescaler1->GetOutput()->GetBufferedRegion();
|
|
|
|
|
//// SizeType3D size3D = region3D.GetSize();
|
|
|
|
|
//// //ImageType3D::PointType origin3D = rescaler1->GetOutput()->GetOrigin();
|
|
|
|
|
//// const itk::Vector<double, 3> resolution3D = rescaler1->GetOutput()->GetSpacing();
|
|
|
|
|
//// ImageDirectionType3D imagDirection = rescaler1->GetOutput()->GetDirection();
|
|
|
|
|
|
|
|
|
|
/* calculate image size in 3D Space */
|
|
|
|
|
using VectorType = itk::Vector<double, 3>;
|
|
|
|
|
VectorType Dest;
|
|
|
|
|
Dest[0]=(size3D[0]-1) * resolution3D[0];
|
|
|
|
|
Dest[1]=(size3D[1]-1) * resolution3D[1];
|
|
|
|
|
Dest[2]=(size3D[2]-1) * resolution3D[2];
|
|
|
|
|
//// /* calculate image size in 3D Space */
|
|
|
|
|
//// using VectorType = itk::Vector<double, 3>;
|
|
|
|
|
//// VectorType Dest;
|
|
|
|
|
//// Dest[0]=(size3D[0]-1) * resolution3D[0];
|
|
|
|
|
//// Dest[1]=(size3D[1]-1) * resolution3D[1];
|
|
|
|
|
//// Dest[2]=(size3D[2]-1) * resolution3D[2];
|
|
|
|
|
|
|
|
|
|
ImageType3D::PointType LastVoxelPosition =
|
|
|
|
|
origin3D + (imagDirection * Dest);
|
|
|
|
|
|
|
|
|
|
// std::cout<<" -------- Localizer 1 ITK --------"<<std::endl;
|
|
|
|
|
// std::cout<<"size3D " <<size3D <<std::endl;
|
|
|
|
|
// std::cout<<"resolution3D " <<resolution3D <<std::endl;
|
|
|
|
|
// std::cout<<"imagDirection " <<imagDirection <<std::endl;
|
|
|
|
|
// std::cout<<"First Voxel position " <<origin3D <<std::endl;
|
|
|
|
|
// std::cout<<"Last Voxel position: "<<LastVoxelPosition<<std::endl;
|
|
|
|
|
// // ImageType3D::PointType LastVoxelPosition =
|
|
|
|
|
// // origin3D + (imagDirection * Dest);
|
|
|
|
|
|
|
|
|
|
// // std::cout<<" -------- Localizer 1 ITK --------"<<std::endl;
|
|
|
|
|
// // std::cout<<"size3D " <<size3D <<std::endl;
|
|
|
|
|
// // std::cout<<"resolution3D " <<resolution3D <<std::endl;
|
|
|
|
|
// // std::cout<<"imagDirection " <<imagDirection <<std::endl;
|
|
|
|
|
// // std::cout<<"First Voxel position " <<origin3D <<std::endl;
|
|
|
|
|
// // std::cout<<"Last Voxel position: "<<LastVoxelPosition<<std::endl;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
double* dBounds = toVTKLocalizer1->GetOutput()->GetBounds();
|
|
|
|
|
// // double* dBounds = toVTKLocalizer1->GetOutput()->GetBounds();
|
|
|
|
|
|
|
|
|
|
// std::cout<< "-------- Localizer 1 VTK --------" <<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<< "-------- Localizer 1 VTK --------" <<std::endl;
|
|
|
|
|
// // std::cout<<"Bounds: "<<dBounds[0]<<" "<<dBounds[1]<<" "
|
|
|
|
|
// // <<dBounds[2]<<" "<<dBounds[3]<<" "
|
|
|
|
|
// // <<dBounds[4]<<" "<<dBounds[5]<<std::endl;
|
|
|
|
|
// // std::cout<< "-------- -------- --------" <<std::endl;
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
return
|
|
|
|
|
toVTKLocalizer1->GetOutput();
|
|
|
|
@ -2030,42 +2031,42 @@ vtkImageData* itkImageProcessor::GetLocalizer2VTK()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(true) {
|
|
|
|
|
using ImageRegionType3D = ImageType3D::RegionType;
|
|
|
|
|
using SizeType3D = ImageRegionType3D::SizeType;
|
|
|
|
|
using ImageDirectionType3D = ImageType3D::DirectionType;
|
|
|
|
|
// if(true) {
|
|
|
|
|
// using ImageRegionType3D = ImageType3D::RegionType;
|
|
|
|
|
// using SizeType3D = ImageRegionType3D::SizeType;
|
|
|
|
|
// using ImageDirectionType3D = ImageType3D::DirectionType;
|
|
|
|
|
|
|
|
|
|
ImageRegionType3D region3D = rescaler2->GetOutput()->GetBufferedRegion();
|
|
|
|
|
SizeType3D size3D = region3D.GetSize();
|
|
|
|
|
ImageType3D::PointType origin3D = rescaler2->GetOutput()->GetOrigin();
|
|
|
|
|
const itk::Vector<double, 3> resolution3D = rescaler2->GetOutput()->GetSpacing();
|
|
|
|
|
ImageDirectionType3D imagDirection = rescaler2->GetOutput()->GetDirection();
|
|
|
|
|
// ImageRegionType3D region3D = rescaler2->GetOutput()->GetBufferedRegion();
|
|
|
|
|
// SizeType3D size3D = region3D.GetSize();
|
|
|
|
|
// ImageType3D::PointType origin3D = rescaler2->GetOutput()->GetOrigin();
|
|
|
|
|
// const itk::Vector<double, 3> resolution3D = rescaler2->GetOutput()->GetSpacing();
|
|
|
|
|
// ImageDirectionType3D imagDirection = rescaler2->GetOutput()->GetDirection();
|
|
|
|
|
|
|
|
|
|
/* calculate image size in 3D Space */
|
|
|
|
|
using VectorType = itk::Vector<double, 3>;
|
|
|
|
|
VectorType Dest;
|
|
|
|
|
Dest[0]=(size3D[0]-1) * resolution3D[0];
|
|
|
|
|
Dest[1]=(size3D[1]-1) * resolution3D[1];
|
|
|
|
|
Dest[2]=(size3D[2]-1) * resolution3D[2];
|
|
|
|
|
// /* calculate image size in 3D Space */
|
|
|
|
|
// using VectorType = itk::Vector<double, 3>;
|
|
|
|
|
// VectorType Dest;
|
|
|
|
|
// Dest[0]=(size3D[0]-1) * resolution3D[0];
|
|
|
|
|
// Dest[1]=(size3D[1]-1) * resolution3D[1];
|
|
|
|
|
// Dest[2]=(size3D[2]-1) * resolution3D[2];
|
|
|
|
|
|
|
|
|
|
ImageType3D::PointType LastVoxelPosition =
|
|
|
|
|
origin3D + (imagDirection * Dest);
|
|
|
|
|
// ImageType3D::PointType LastVoxelPosition =
|
|
|
|
|
// origin3D + (imagDirection * Dest);
|
|
|
|
|
|
|
|
|
|
// std::cout<<" -------- Localizer 2 ITK --------"<<std::endl;
|
|
|
|
|
// std::cout<<"size3D " <<size3D <<std::endl;
|
|
|
|
|
// std::cout<<"resolution3D " <<resolution3D <<std::endl;
|
|
|
|
|
// std::cout<<"imagDirection " <<imagDirection <<std::endl;
|
|
|
|
|
// std::cout<<"First Voxel position " <<origin3D <<std::endl;
|
|
|
|
|
// std::cout<<"Last Voxel position: "<<LastVoxelPosition<<std::endl;
|
|
|
|
|
// // std::cout<<" -------- Localizer 2 ITK --------"<<std::endl;
|
|
|
|
|
// // std::cout<<"size3D " <<size3D <<std::endl;
|
|
|
|
|
// // std::cout<<"resolution3D " <<resolution3D <<std::endl;
|
|
|
|
|
// // std::cout<<"imagDirection " <<imagDirection <<std::endl;
|
|
|
|
|
// // std::cout<<"First Voxel position " <<origin3D <<std::endl;
|
|
|
|
|
// // std::cout<<"Last Voxel position: "<<LastVoxelPosition<<std::endl;
|
|
|
|
|
|
|
|
|
|
// double* dBounds = toVTKLocalizer2->GetOutput()->GetBounds();
|
|
|
|
|
// std::cout<< "-------- Localizer 2 VTK --------" <<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 = toVTKLocalizer2->GetOutput()->GetBounds();
|
|
|
|
|
// // std::cout<< "-------- Localizer 2 VTK --------" <<std::endl;
|
|
|
|
|
// // std::cout<<"Bounds: "<<dBounds[0]<<" "<<dBounds[1]<<" "
|
|
|
|
|
// // <<dBounds[2]<<" "<<dBounds[3]<<" "
|
|
|
|
|
// // <<dBounds[4]<<" "<<dBounds[5]<<std::endl;
|
|
|
|
|
// // std::cout<< "-------- -------- --------" <<std::endl;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -2154,11 +2155,6 @@ vtkImageData* itkImageProcessor::GetProjection1VTK()
|
|
|
|
|
vtkMatrix4x4 * itkImageProcessor::GetProjection1VTKTransform()
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
// std::cout<< "Composed " <<std::endl;
|
|
|
|
|
// interpolator1->GetComposedTransform()->Print(std::cout);
|
|
|
|
|
// std::cout<< "Inverse " <<std::endl;
|
|
|
|
|
// interpolator1->GetInverseTransform()->Print(std::cout);
|
|
|
|
|
|
|
|
|
|
m_Projection1VTKTransform->Identity();
|
|
|
|
|
|
|
|
|
|
for(int iIdx = 0; iIdx<3 ; iIdx++){
|
|
|
|
@ -2398,22 +2394,6 @@ itkImageProcessor::GetCompleteIsocentricTransform
|
|
|
|
|
return nullptr;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// std::cout<<" --- GetCompleteIsocentricTransform --- "<<std::endl;
|
|
|
|
|
|
|
|
|
|
// std::cout<< "R: "<<
|
|
|
|
|
// m_TransformMetaInfo->GetR()[0] <<" "<<
|
|
|
|
|
// m_TransformMetaInfo->GetR()[1] <<" "<<
|
|
|
|
|
// m_TransformMetaInfo->GetR()[2] <<" "<<std::endl;
|
|
|
|
|
// std::cout<< "T: "<<
|
|
|
|
|
// m_TransformMetaInfo->GetT()[0] <<" "<<
|
|
|
|
|
// m_TransformMetaInfo->GetT()[1] <<" "<<
|
|
|
|
|
// m_TransformMetaInfo->GetT()[2] <<" "<<std::endl;
|
|
|
|
|
// std::cout<< "Import Offset: "<<
|
|
|
|
|
// m_CTMetaInfo->GetImportOffset()[0]<<" "<<
|
|
|
|
|
// m_CTMetaInfo->GetImportOffset()[1]<<" "<<
|
|
|
|
|
// m_CTMetaInfo->GetImportOffset()[2]<<" "<<std::endl;
|
|
|
|
|
// std::cout<<" --- --- --- "<<std::endl;
|
|
|
|
|
|
|
|
|
|
ImageType3D::PointType mISORTIEC =
|
|
|
|
|
m_CTMetaInfo->GetLPS2IECDirections() * m_RTMetaInfo->GetIsocenterLPS();
|
|
|
|
|
|
|
|
|
@ -2465,8 +2445,8 @@ void itkImageProcessor::SetRegionFixed1(
|
|
|
|
|
roiAutoReg1.SetIndex(index1);
|
|
|
|
|
roiAutoReg1.SetSize(size1);
|
|
|
|
|
|
|
|
|
|
std::cout << "itkImageProcessor " << std::endl;
|
|
|
|
|
std::cout << roiAutoReg1 << std::endl;
|
|
|
|
|
//std::cout << "itkImageProcessor " << std::endl;
|
|
|
|
|
//std::cout << roiAutoReg1 << std::endl;
|
|
|
|
|
|
|
|
|
|
this->m_R23->SetroiAutoReg1(roiAutoReg1);
|
|
|
|
|
|
|
|
|
@ -2490,8 +2470,8 @@ void itkImageProcessor::SetRegionFixed2(
|
|
|
|
|
roiAutoReg2.SetIndex(index2);
|
|
|
|
|
roiAutoReg2.SetSize(size2);
|
|
|
|
|
|
|
|
|
|
std::cout << "itkImageProcessor " << std::endl;
|
|
|
|
|
std::cout << roiAutoReg2 << std::endl;
|
|
|
|
|
//std::cout << "itkImageProcessor " << std::endl;
|
|
|
|
|
//std::cout << roiAutoReg2 << std::endl;
|
|
|
|
|
|
|
|
|
|
this->m_R23->SetroiAutoReg2(roiAutoReg2);
|
|
|
|
|
|
|
|
|
|