-
Notifications
You must be signed in to change notification settings - Fork 165
Displaced detector #877
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
base: main
Are you sure you want to change the base?
Displaced detector #877
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -116,6 +116,13 @@ class ITK_TEMPLATE_EXPORT DisplacedDetectorImageFilter : public itk::InPlaceImag | |
| itkGetMacro(InferiorCorner, double); | ||
| itkGetMacro(SuperiorCorner, double); | ||
|
|
||
| /** Returns true when offsets were explicitly provided */ | ||
| bool | ||
| GetOffsetsSet() const | ||
| { | ||
| return m_OffsetsSet; | ||
| } | ||
|
|
||
|
Comment on lines
+119
to
+125
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please use ITK's GetMacro for booleans |
||
| /** Checks that inputs are correctly set. */ | ||
| void | ||
| VerifyPreconditions() const override; | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -96,6 +96,30 @@ main(int, char **) | |
|
|
||
| CheckImageQuality<OutputImageType>(streamingCUDA->GetOutput(), streamingCPU->GetOutput(), 1.e-6, 100, 1.); | ||
| } | ||
| { | ||
| constexpr double minOffset = -16.; | ||
| constexpr double maxOffset = 12.; | ||
|
|
||
| std::cout << "\n\n****** Case 4: manual offsets ******" << std::endl; | ||
|
|
||
| using OffsetDDFType = rtk::DisplacedDetectorForOffsetFieldOfViewImageFilter<OutputImageType>; | ||
| auto cudaddf = OffsetDDFType::New(); | ||
| cudaddf->SetInput(slp->GetOutput()); | ||
| cudaddf->SetGeometry(geometry); | ||
| cudaddf->SetOffsets(minOffset, maxOffset); | ||
| cudaddf->InPlaceOff(); | ||
| TRY_AND_EXIT_ON_ITK_EXCEPTION(cudaddf->Update()); | ||
|
|
||
| using CPUDDFType = rtk::DisplacedDetectorImageFilter<OutputImageType>; | ||
| auto cpuddf = CPUDDFType::New(); | ||
| cpuddf->SetInput(slp->GetOutput()); | ||
| cpuddf->SetGeometry(geometry); | ||
| cpuddf->SetOffsets(minOffset, maxOffset); | ||
| cpuddf->InPlaceOff(); | ||
| TRY_AND_EXIT_ON_ITK_EXCEPTION(cpuddf->Update()); | ||
|
|
||
| CheckImageQuality<OutputImageType>(cudaddf->GetOutput(), cpuddf->GetOutput(), 1.e-6, 100, 1.); | ||
| } | ||
|
Comment on lines
+99
to
+122
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The problem of this test is that it is not an offset FOV. In this case, DisplacedDetectorImageFilter can be used. |
||
|
|
||
| // If all succeed | ||
| std::cout << "\n\nTest PASSED! " << std::endl; | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we should do the same as in the base class. I suggest to throw an error message instead of copy pasting code, that's will be simpler.