Panel offset in contour projector
This commit is contained in:
@ -70,17 +70,11 @@ itkImageProcessor::itkImageProcessor()
|
||||
}
|
||||
}
|
||||
|
||||
m_3DInputChangeInformationToZero =
|
||||
ChangeInformationFilterType::New();
|
||||
|
||||
|
||||
m_Projection1VTKTransform = vtkMatrix4x4::New();
|
||||
m_Projection1VTKTransform->Identity();
|
||||
m_Projection2VTKTransform = vtkMatrix4x4::New();
|
||||
m_Projection2VTKTransform->Identity();
|
||||
|
||||
|
||||
|
||||
/* Set to NULL the metainfo */
|
||||
m_CTMetaInfo = NULL;
|
||||
|
||||
@ -230,6 +224,38 @@ double itkImageProcessor::GetSCD2(){
|
||||
m_DRTImage2MetaInfo ->GetSCD();
|
||||
}
|
||||
|
||||
|
||||
double itkImageProcessor::GetPanelOffsetPGeo(tProjOrientationType ImgPrj){
|
||||
|
||||
if(m_CTMetaInfo == NULL ||
|
||||
m_DRTGeometryMetaInfo == NULL)
|
||||
return 0.;
|
||||
|
||||
|
||||
switch (ImgPrj) {
|
||||
case tProjOrientationType::PA:
|
||||
return
|
||||
this->CalcPanelOffsetPGeo(m_CTMetaInfo->GetPatientOrientation(),
|
||||
-m_DRTGeometryMetaInfo->GetPanel1Offset());
|
||||
break;
|
||||
|
||||
case tProjOrientationType::LAT:
|
||||
return
|
||||
this->CalcPanelOffsetPGeo(m_CTMetaInfo->GetPatientOrientation(),
|
||||
-m_DRTGeometryMetaInfo->GetPanel2Offset());
|
||||
break;
|
||||
|
||||
case tProjOrientationType::NA:
|
||||
return 0.;
|
||||
break;
|
||||
|
||||
default:
|
||||
return 0.;
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void itkImageProcessor::SetPanelOffsets(double dOff1, double dOff2)
|
||||
{
|
||||
m_DRTGeometryMetaInfo->SetPanel1Offset(dOff1);
|
||||
@ -613,50 +639,9 @@ int itkImageProcessor::fill3DVolumeMeta(
|
||||
// to be (0,0,0). Because we align the CT isocenter with the central axis, the projection
|
||||
// geometry is fully defined. The origin of the CT image becomes irrelavent.
|
||||
|
||||
ImageType3D::PointType pZeroOrigin;
|
||||
pZeroOrigin[0] = 0;//2312312;//-m_VolumeSourceDupli->GetOutput()->GetOrigin()[0]; //0.;
|
||||
pZeroOrigin[1] = 0;//23;//-m_VolumeSourceDupli->GetOutput()->GetOrigin()[1]; //0.;
|
||||
pZeroOrigin[2] = 0;//4444;//-m_VolumeSourceDupli->GetOutput()->GetOrigin()[2]; //0.;
|
||||
|
||||
if (m_3DInputChangeInformationToZero) {
|
||||
m_3DInputChangeInformationToZero = NULL;
|
||||
m_3DInputChangeInformationToZero = ChangeInformationFilterType::New();
|
||||
}
|
||||
|
||||
m_VolumeSourceDupli->GetOutput()->GetOrigin();
|
||||
ImageType3D::RegionType lagerReg =
|
||||
m_VolumeSourceDupli->GetOutput()->GetLargestPossibleRegion();
|
||||
// this is done internally in the dSiddonFilter.
|
||||
|
||||
|
||||
|
||||
std::cout<<"CCASASDASASD "<<lagerReg<<std::endl;
|
||||
ImageType3D::PointType pPoint;
|
||||
m_VolumeSourceDupli->GetOutput()
|
||||
->TransformIndexToPhysicalPoint(lagerReg.GetIndex(),pPoint);
|
||||
std::cout<<"CCASASDASASD "<<pPoint<<std::endl;
|
||||
|
||||
//CHECK THIS ZERO.
|
||||
|
||||
m_3DInputChangeInformationToZero->SetInput(
|
||||
m_VolumeSourceDupli->GetOutput());
|
||||
m_3DInputChangeInformationToZero->SetOutputOrigin(
|
||||
pZeroOrigin);
|
||||
m_3DInputChangeInformationToZero->ChangeOriginOn();
|
||||
|
||||
m_3DInputChangeInformationToZero->UpdateOutputInformation();
|
||||
m_3DInputChangeInformationToZero->Update();
|
||||
|
||||
image3DIn =
|
||||
m_3DInputChangeInformationToZero->GetOutput();
|
||||
|
||||
lagerReg =
|
||||
m_3DInputChangeInformationToZero->GetOutput()->GetLargestPossibleRegion();
|
||||
std::cout<<"CCASASDASASD "<<lagerReg<<std::endl;
|
||||
m_3DInputChangeInformationToZero->GetOutput()
|
||||
->TransformIndexToPhysicalPoint(lagerReg.GetIndex(),pPoint);
|
||||
std::cout<<"CCASASDASASD "<<pPoint<<std::endl;
|
||||
|
||||
//m_3DInputChangeInformationToZero->get
|
||||
return EXIT_SUCCESS;
|
||||
|
||||
|
||||
@ -1357,9 +1342,6 @@ void itkImageProcessor::InitializeProjector()
|
||||
transform1->SetCenter(
|
||||
m_DRTImage1MetaInfo->GetProjectionOriginLPSZero() );
|
||||
|
||||
std::cout<<"---> CENTER PA " <<
|
||||
m_DRTImage1MetaInfo->GetProjectionOriginLPSZero()<<std::endl;
|
||||
|
||||
// 2D Image 1
|
||||
interpolator1->SetProjectionAngle(
|
||||
dtr * m_DRTImage1MetaInfo->GetProjectionAngleLPS() );
|
||||
@ -1392,11 +1374,8 @@ void itkImageProcessor::InitializeProjector()
|
||||
CurrTransform->GetAngleZ()
|
||||
);
|
||||
|
||||
|
||||
transform2->SetCenter(
|
||||
m_DRTImage2MetaInfo->GetProjectionOriginLPSZero() );
|
||||
//transform2->Print(std::cout);
|
||||
|
||||
|
||||
// 2D Image 2
|
||||
interpolator2->SetProjectionAngle(
|
||||
@ -1414,22 +1393,11 @@ void itkImageProcessor::InitializeProjector()
|
||||
|
||||
resampleFilter1 = ResampleFilterType::New();
|
||||
resampleFilter1->SetInput(
|
||||
image3DIn);
|
||||
//m_VolumeSourceDupli->GetOutput());
|
||||
//image3DIn);
|
||||
m_VolumeSourceDupli->GetOutput());
|
||||
|
||||
ImageType3D::RegionType lagerReg =
|
||||
m_VolumeSourceDupli->GetOutput()->GetLargestPossibleRegion();
|
||||
|
||||
std::cout<<"CCASASDASASD "<<lagerReg<<std::endl;
|
||||
ImageType3D::PointType pPoint;
|
||||
m_VolumeSourceDupli->GetOutput()
|
||||
->TransformIndexToPhysicalPoint(lagerReg.GetIndex(),pPoint);
|
||||
std::cout<<"CCASASDASASD "<<pPoint<<std::endl;
|
||||
|
||||
|
||||
|
||||
|
||||
resampleFilter1->SetDefaultPixelValue(0);
|
||||
resampleFilter1->SetNumberOfWorkUnits(iNWUnits);
|
||||
|
||||
@ -1449,7 +1417,7 @@ void itkImageProcessor::InitializeProjector()
|
||||
resampleFilter2 = ResampleFilterType::New();
|
||||
resampleFilter2->SetInput(
|
||||
m_VolumeSourceDupli->GetOutput());
|
||||
//image3DIn);
|
||||
|
||||
resampleFilter2->SetDefaultPixelValue(0);
|
||||
resampleFilter2->SetNumberOfWorkUnits(iNWUnits);
|
||||
|
||||
|
@ -152,6 +152,10 @@ public:
|
||||
|
||||
/** Panel offsets - panel offsets IEC */
|
||||
void SetPanelOffsets(double,double);
|
||||
|
||||
/** Panel offsets - takes into account patient orientation */
|
||||
double GetPanelOffsetPGeo(tProjOrientationType ImgPrj);
|
||||
|
||||
/** Get projection angles - Gantry angle LPS
|
||||
* Only meaningful after a 3D Volume is loaded */
|
||||
double GetPanelOffset1();
|
||||
@ -311,7 +315,6 @@ private:
|
||||
toVTKLocalizer2;
|
||||
|
||||
InternalImageType::Pointer
|
||||
image3DIn,
|
||||
imageDRT1In,
|
||||
imageDRT2In;
|
||||
|
||||
@ -322,9 +325,6 @@ private:
|
||||
m_PASourceDupli,
|
||||
m_VolumeSourceDupli;
|
||||
|
||||
ChangeInformationFilterType::Pointer
|
||||
m_3DInputChangeInformationToZero;
|
||||
|
||||
/** Apply transform to CT volume.
|
||||
* This moves the volume based on RT Plan info
|
||||
* if those are available. */
|
||||
|
@ -43,6 +43,7 @@ vtkContourTopogramProjectionFilter::vtkContourTopogramProjectionFilter()
|
||||
this->dImportOffsetLPS[2] = 0.;
|
||||
|
||||
this->dSCD = 0.;
|
||||
this->dPOffset = 0.;
|
||||
|
||||
this->m_RefTransform = nullptr;
|
||||
this->m_Transform = nullptr;
|
||||
@ -152,7 +153,7 @@ int vtkContourTopogramProjectionFilter::RequestData(
|
||||
/** correct x coordinate by the ratio of distance from source
|
||||
* Basic intercept theorem */
|
||||
if(pp1[2] != 0.){
|
||||
pp1[0] = pp1[0] * dSCD / abs(pp1[2]);
|
||||
pp1[0] = (pp1[0] * dSCD / abs(pp1[2])) + dPOffset;
|
||||
} else {
|
||||
vtkDebugMacro("point at SCD distance from panel. Skipping lateral correction for this point.");
|
||||
}
|
||||
@ -213,6 +214,11 @@ void vtkContourTopogramProjectionFilter::SetSCD(const double dVal){
|
||||
dSCD = dVal;
|
||||
}
|
||||
|
||||
void vtkContourTopogramProjectionFilter::SetPanelOffset(const double dVal){
|
||||
dPOffset = dVal;
|
||||
}
|
||||
|
||||
|
||||
void vtkContourTopogramProjectionFilter::SetLPStoProjectionLPSGeometryOffset(const double * dP)
|
||||
{
|
||||
memcpy(dProjectionLPSOffset,dP,3*sizeof(double));
|
||||
|
@ -40,6 +40,7 @@ public:
|
||||
void SetLPStoProjectionLPSGeometryOffset (const double * );
|
||||
void SetSCD(const double dVal);
|
||||
void SetImportOffsetLPS(const double *);
|
||||
void SetPanelOffset(const double dVal);
|
||||
|
||||
void cleanUpFilter();
|
||||
|
||||
@ -60,7 +61,8 @@ private:
|
||||
double
|
||||
dProjectionLPSOffset[3],
|
||||
dImportOffsetLPS[3],
|
||||
dSCD;
|
||||
dSCD,
|
||||
dPOffset;
|
||||
|
||||
vtkTransform *m_RefTransform;
|
||||
vtkTransform *m_Transform;
|
||||
|
Reference in New Issue
Block a user