-
Notifications
You must be signed in to change notification settings - Fork 168
CUDA Zeng forward and back projectors in RTK #977
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
Open
CoConstan
wants to merge
4
commits into
RTKConsortium:main
Choose a base branch
from
CoConstan:CudaZeng
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
9070a96
ENH: Add CUDA Zeng projectors
CoConstan c913798
ENH: Address CUDA Zeng review comments
CoConstan 66ea1a6
BUG: Match CPU max-slice calculation, border interpolation, and first…
CoConstan ee2729c
ENH: Add configurable depth-slice batching to CUDA Zeng projectors
CoConstan File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,9 +1,9 @@ | ||
| section "Projectors" | ||
| option "fp" f "Forward projection method" values="Joseph","CudaRayCast","JosephAttenuated","Zeng" enum no default="Joseph" | ||
| option "bp" b "Back projection method" values="VoxelBasedBackProjection","Joseph","CudaVoxelBased","CudaRayCast","JosephAttenuated", "Zeng" enum no default="VoxelBasedBackProjection" | ||
| option "fp" f "Forward projection method" values="Joseph","CudaRayCast","JosephAttenuated","Zeng","CudaZeng" enum no default="Joseph" | ||
| option "bp" b "Back projection method" values="VoxelBasedBackProjection","Joseph","CudaVoxelBased","CudaRayCast","JosephAttenuated", "Zeng", "CudaZeng" enum no default="VoxelBasedBackProjection" | ||
| option "step" - "Step size along ray (for CudaRayCast only, default to the minimum voxel spacing of the input volume if set to 0)" double no default="0" | ||
| option "attenuationmap" - "Attenuation map relative to the volume to perfom the attenuation correction (JosephAttenuated and Zeng)" string no | ||
| option "sigmazero" - "PSF value at a distance of 0 meter of the detector (Zeng only)" double no | ||
| option "alphapsf" - "Slope of the PSF against the detector distance (Zeng only)" double no | ||
| option "attenuationmap" - "Attenuation map relative to the volume to perform the attenuation correction (JosephAttenuated, Zeng and CudaZeng)" string no | ||
| option "sigmazero" - "PSF value at a distance of 0 meter of the detector (Zeng and CudaZeng only)" double no | ||
| option "alphapsf" - "Slope of the PSF against the detector distance (Zeng and CudaZeng only)" double no | ||
| option "inferiorclipimage" - "Inferior clip of the ray for each pixel of the projections (Joseph only)" string no | ||
| option "superiorclipimage" - "Superior clip of the ray for each pixel of the projections (Joseph only)" string no |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,82 @@ | ||
| /*========================================================================= | ||
| * | ||
| * Copyright RTK Consortium | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * https://www.apache.org/licenses/LICENSE-2.0.txt | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| * | ||
| *=========================================================================*/ | ||
| #ifndef rtkCudaZengBackProjectionImageFilter_h | ||
| #define rtkCudaZengBackProjectionImageFilter_h | ||
|
|
||
| #include "rtkConfiguration.h" | ||
| #ifdef RTK_USE_CUDA | ||
|
|
||
| # include "rtkZengBackProjectionImageFilter.h" | ||
| # include "RTKExport.h" | ||
| # include <itkCudaImage.h> | ||
| # include <itkCudaInPlaceImageFilter.h> | ||
| # include <itkImageBase.h> | ||
|
|
||
| namespace rtk | ||
| { | ||
|
|
||
| /** \class CudaZengBackProjectionImageFilter | ||
| * \brief CUDA implementation of the rotation-based Zeng backprojector. | ||
| * | ||
| * The implementation reproduces the slice recursion of | ||
| * ZengBackProjectionImageFilter, including the depth-dependent Gaussian PSF | ||
| * and the optional attenuation map (input 2). | ||
| * See Zeng et al., IEEE Transactions on Medical Imaging, 1999, | ||
| * doi:10.1109/42.796285. | ||
| * | ||
| * \ingroup RTK Projector CudaImageToImageFilter | ||
| */ | ||
| class RTK_EXPORT CudaZengBackProjectionImageFilter | ||
| : public itk::CudaInPlaceImageFilter< | ||
| itk::CudaImage<float, 3>, | ||
| itk::CudaImage<float, 3>, | ||
| ZengBackProjectionImageFilter<itk::CudaImage<float, 3>, itk::CudaImage<float, 3>>> | ||
| { | ||
| public: | ||
| ITK_DISALLOW_COPY_AND_MOVE(CudaZengBackProjectionImageFilter); | ||
| using ImageType = itk::CudaImage<float, 3>; | ||
| /** Metadata-only image used to build the rotated-grid transforms. Using | ||
| * ImageBase avoids the CUDA image factory replacing itk::Image::New(). */ | ||
| using CPUImageType = itk::ImageBase<3>; | ||
| using ProjectorType = ZengBackProjectionImageFilter<ImageType, ImageType>; | ||
| using Self = CudaZengBackProjectionImageFilter; | ||
| using Superclass = itk::CudaInPlaceImageFilter<ImageType, ImageType, ProjectorType>; | ||
| using Pointer = itk::SmartPointer<Self>; | ||
| using ConstPointer = itk::SmartPointer<const Self>; | ||
|
|
||
| itkNewMacro(Self); | ||
| itkOverrideGetNameOfClassMacro(CudaZengBackProjectionImageFilter); | ||
|
|
||
| /** Maximum number of projections processed together. Zero selects the automatic size (default). */ | ||
| itkSetMacro(BatchSize, unsigned int); | ||
| itkGetConstMacro(BatchSize, unsigned int); | ||
|
|
||
| protected: | ||
| CudaZengBackProjectionImageFilter(); | ||
| ~CudaZengBackProjectionImageFilter() override; | ||
| void | ||
| GPUGenerateData() override; | ||
|
|
||
| private: | ||
| void * m_CudaWorkspace{ nullptr }; | ||
| unsigned int m_BatchSize{ 0 }; | ||
| }; | ||
|
|
||
| } // namespace rtk | ||
| #endif // RTK_USE_CUDA | ||
| #endif // rtkCudaZengBackProjectionImageFilter_h | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Can you add [Zeng et al, IEEE TMI, [Zeng et al, 1999, IEEE TMI, 10.1109/42.796285]