Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GPU version Demons: the size of output is different from that of input image #11

Open
zhang-qiang-github opened this issue Feb 19, 2020 · 1 comment

Comments

@zhang-qiang-github
Copy link

I am using GPU Demons for myself project. I find a strange bug: the size of input (fix and moving image) is (174, 256, 256), but the size of output is (87, 128, 128).

The main code is:

RegistrationFilterType::Pointer DemonsFilter = RegistrationFilterType::New();
CommandIterationUpdate::Pointer observer = CommandIterationUpdate::New();
DemonsFilter->AddObserver(itk::IterationEvent(), observer);
DemonsFilter->SetFixedImage(fixImageCPUToGPUFilter->GetOutput());
DemonsFilter->SetMovingImage(movingImageCPUToGPUFilter->GetOutput());
DemonsFilter->GetOutput()->SetRequestedRegionToLargestPossibleRegion();
auto sizexxx = gpuDisplacementField->GetLargestPossibleRegion().GetSize();
if (i != 0)
{
	DemonsFilter->SetInitialDisplacementField(gpuDisplacementField);
}
else
{
	DemonsFilter->SetInitialDisplacementField(nullptr);
}

DemonsFilter->SetNumberOfIterations(nIterations[i]);
DemonsFilter->SetStandardDeviations(1.0);
DemonsFilter->Update();
auto fixImageSize = DemonsFilter->GetFixedImage()->GetLargestPossibleRegion().GetSize();
std::cout << "fix image size: " << fixImageSize << std::endl;
auto movingImageSize = DemonsFilter->GetMovingImage()->GetLargestPossibleRegion().GetSize();
std::cout << "moving image size: " << movingImageSize << std::endl;
auto displacementSize = DemonsFilter->GetOutput()->GetLargestPossibleRegion().GetSize();
std::cout << "displacement size: " << displacementSize << std::endl;

And the information in the console is:

fix image size: [174, 256, 256]
moving image size: [174, 256, 256]
displacement size: [87, 128, 128]

Why the size of displacement is not (174, 256, 256) ??
Moreover, I have visualized the displacement field, and the result is just random noise. Also, I have checked the input fix and moving image, and they are correct.
How can I make the demons registration correct?

@stale
Copy link

stale bot commented Jun 19, 2020

This issue has been automatically marked as stale because it has not had recent activity. Thank you for your contributions.

@thewtex thewtex transferred this issue from InsightSoftwareConsortium/ITK Jun 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant