[Insight-users] problem setting a schedule for multi resolution registration
Isabelle Renaud
isabelle at hermesmedical.com
Fri Nov 25 14:06:30 EST 2011
Hi all,
I am trying to define a particular schedule for a multi-resolution registration.
I have 2 data: the fixed image is a CT of 512x512x47
The moving image is a PET of 128x128x47
I want to bring both data at same resolution at coarsest level of registration and I don' want to use data smaller that 32x32. So that, I will have 5 levels:
Ct would be 32x32x47
64x64x47
128x128x47
256x256x47
512x512x47
And Pet will be 32x32x47
64x64x47
128x128x47
128x128x47
128x128x47
Here is an extract of my code:
int fixedImageNumberOfLevels = 5;
int movingImageNumberOfLevels = 3;
int numberOfLevels = qMax(fixedImageNumberOfLevels, movingImageNumberOfLevels);
registration_->SetNumberOfLevels(numberOfLevels);
RegistrationType::ScheduleType fixedImageSchedule = registration_->GetFixedImagePyramid()->GetSchedule();
unsigned int shrinkFactor = 1 << (fixedImageNumberOfLevels - 1);
fixedImageSchedule[0][0] = shrinkFactor;
fixedImageSchedule[0][1] = shrinkFactor;
fixedImageSchedule[0][2] = 1;
for (int level = 1; level < numberOfLevels; level++){
fixedImageSchedule[level][0] = 2 * fixedImageSchedule[level-1][0];
fixedImageSchedule[level][1] = 2 * fixedImageSchedule[level-1][1];
fixedImageSchedule[level][2] = 1;
}
registration_->GetFixedImagePyramid()->SetSchedule(fixedImageSchedule);
RegistrationType::ScheduleType movingImageSchedule= registration_->GetMovingImagePyramid()->GetSchedule();
shrinkFactor = 1 << (movingImageNumberOfLevels - 1);
movingImageSchedule[0][0] = shrinkFactor;
movingImageSchedule[0][1] = shrinkFactor;
movingImageSchedule[0][2] = 1;
for (int level = 1; level < numberOfLevels; level++){
movingImageSchedule[level][0] = 2 * movingImageSchedule[level-1][0];
movingImageSchedule[level][1] = 2 * movingImageSchedule[level-1][1];
movingImageSchedule[level][2] = 1;
}
registration_->GetFixedImagePyramid()->SetSchedule(movingImageSchedule);
As printing the info during registration, I find out that:
Numer of levels = 1
FixedImagePyramidSchedule is empty, same for MovingImagePyramid
And fixed image region is of size
Level 0: 64x64x47
Level 1:128x128x47
I tried also, SetStartingShrinkSchedule, which I found very convenient but it didn't work. I also tried SetSchedules(fixedImageSchedule, movingImageSchedule), no chance either. What am I doing true?
Please, help.
Regards,
Isabelle
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20111125/bbce0fe4/attachment.htm>
More information about the Insight-users
mailing list