-
Notifications
You must be signed in to change notification settings - Fork 144
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Mikhail Polkovnikov
committed
Mar 1, 2024
1 parent
177cdf0
commit d7e3e5a
Showing
2 changed files
with
41 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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 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,40 @@ | ||
#!/usr/bin/env python | ||
from __future__ import print_function | ||
import itk | ||
from itk import RTK as rtk | ||
import sys | ||
import os | ||
|
||
TImageType = itk.Image[itk.F,3] | ||
# Defines the RTK geometry object | ||
geometry = rtk.ThreeDCircularProjectionGeometry.New() | ||
numberOfProjections = 1 | ||
geometry.AddProjection(700, 800, 0) | ||
# Constant image sources | ||
# Create MIP Forward Projector volume | ||
volInput = rtk.ConstantImageSource[TImageType].New() | ||
origin = [ 0., 0., 0. ] | ||
size = [ 64, 64, 64 ] | ||
sizeOutput = [ 200, 200, numberOfProjections ] | ||
spacing = [ 4.0, 4.0, 4.0 ] | ||
spacingOutput = [ 1.0, 1.0, 1.0 ] | ||
volInput.SetOrigin( origin ) | ||
volInput.SetSpacing( spacing ) | ||
volInput.SetSize( size ) | ||
volInput.SetConstant(1.0) | ||
volInput.UpdateOutputInformation() | ||
volInputSource = volInput.GetOutput() | ||
# Initialization Imager volume | ||
projInput = rtk.ConstantImageSource[TImageType].New() | ||
projInput.SetOrigin( origin ) | ||
projInput.SetSpacing( spacingOutput ) | ||
projInput.SetSize( sizeOutput ) | ||
projInput.SetConstant(0.) | ||
projInput.Update() | ||
projInputSource = projInput.GetOutput() | ||
# MIP Forward Projection filter | ||
mip = rtk.MaximumIntensityProjectionImageFilter[TImageType, TImageType].New() | ||
mip.SetGeometry( geometry ) | ||
mip.SetInput(volInputSource) | ||
mip.SetInput(1, projInputSource) | ||
mipImage = mip.GetOutput() |