Reg23 ROI

- fixed the known issue of ROI not defined automatically before interaction
- whole region is used as default, until user changes that
- reset on patient unload, the next one should start again from full region.
This commit is contained in:
Proton local user
2023-05-24 13:18:06 +02:00
parent 3e8a113ae6
commit 98ada50379
3 changed files with 34 additions and 4 deletions

View File

@ -388,6 +388,8 @@ int itkImageProcessor::unload3DVolumeAndMeta(){
m_TransformMetaInfo = TransformMetaInformation::New();
this->ResetROIRegions();
return 1;
}
@ -2500,11 +2502,13 @@ void itkImageProcessor::SetRegionFixed2(
void itkImageProcessor::ResetROIRegions(){
auto region1temp = m_PASourceDupli->GetOutput()->GetBufferedRegion();
auto region2temp = m_LATSourceDupli->GetOutput()->GetBufferedRegion();
// auto region1temp = m_PASourceDupli->GetOutput()->GetBufferedRegion();
// auto region2temp = m_LATSourceDupli->GetOutput()->GetBufferedRegion();
this->m_R23->SetroiAutoReg1(region1temp);
this->m_R23->SetroiAutoReg2(region2temp);
// this->m_R23->SetroiAutoReg1(region1temp);
// this->m_R23->SetroiAutoReg2(region2temp);
this->m_R23->setROISizeToZero();
}

View File

@ -46,6 +46,8 @@ itkReg23::itkReg23()
// m_UseFullROI = true; // if the full image ROI shall be used
m_UseDumptoFile = false; //If each (!) optimzer result shall be dumpped into a file.
this->setROISizeToZero();
}
@ -54,6 +56,16 @@ itkReg23::~itkReg23()
}
void itkReg23::setROISizeToZero(){
ImageType3D::SizeType zeroSize;
zeroSize.Fill(0);
m_roiAutoReg1.SetSize(zeroSize);
m_roiAutoReg2.SetSize(zeroSize);
}
void itkReg23::PrintSelf(std::ostream& os, Indent indent) const
{
Superclass::PrintSelf(os, indent);
@ -208,6 +220,18 @@ void itkReg23::InitializeRegistration(
registration->SetFixedImage2(m_LAT);
registration->SetMovingImage(m_Volume);
if( this->GetroiAutoReg1().GetNumberOfPixels() == 0 ){
auto defaultRegion = m_PA->GetBufferedRegion();
this->SetroiAutoReg1(defaultRegion);
std::cout<< "Image1 region not defined. Using the whole image buffered region" <<std::endl;
}
if( this->GetroiAutoReg2().GetNumberOfPixels() == 0 ){
auto defaultRegion = m_LAT->GetBufferedRegion();
this->SetroiAutoReg2(defaultRegion);
std::cout<< "Image2 region not defined. Using the whole image buffered region" <<std::endl;
}
registration->SetFixedImageRegion1(m_roiAutoReg1);
registration->SetFixedImageRegion2(m_roiAutoReg2);

View File

@ -108,6 +108,8 @@ public:
/** Auto Reg23 methods END */
void setROISizeToZero();
protected:
itkReg23();
virtual ~itkReg23();