Comments (1)
//Author \Hans J. Johnson
// Test program to find bug in periodic boundary conditions.
#include <rtkForwardDifferenceGradientImageFilter.h>
#include <rtkBackwardDifferenceDivergenceImageFilter.h>
const size_t IM2DSIZE=3;
template
void DumpImage(IMTYPE out)
{
typename IMTYPE::ObjectType::IndexType idx;
std::cout << "==========================================" << std::endl;
for(size_t k = 0; k < IM2DSIZE; ++k)
{
idx[2] = k;
for(size_t j = 0; j < IM2DSIZE; ++j)
{
idx[1]=j;
for(size_t i = 0; i< IM2DSIZE; ++i)
{
idx[0]=i;
std::cout.width(16);
std::cout.fill(' ');
std::cout << std::right << out->GetPixel(idx);
}
std::cout << std::endl;
}
std::cout << ". - . - . - . - . - . - . - . - . - . - . " << std::endl;
}
std::cout << "==========================================" << std::endl;
}
int main( int argc, char * argv[])
{
typedef itk::Image<float,3> Image2D;
Image2D::Pointer im2 = Image2D::New();
Image2D::RegionType region;
Image2D::RegionType::SizeType size;
size.Fill(IM2DSIZE);
region.SetSize(size);
im2->SetRegions(region);
im2->Allocate(true);
Image2D::IndexType idx;
idx.Fill(IM2DSIZE/2);
idx.Fill(0);
im2->SetPixel(idx,1.0F);
//typedef itk::GradientImageFilter GradientType;
typedef rtk::ForwardDifferenceGradientImageFilter GradientType;
GradientType::Pointer grad = GradientType::New();
grad->SetInput(im2);
typedef itk::PeriodicBoundaryCondition FloatBoundaryType;
grad->OverrideBoundaryCondition( new FloatBoundaryType );
grad->Update();
GradientType::OutputImageType::Pointer gradIm = grad->GetOutput();
//typedef itk::DivergenceImageFilterGradientType::OutputImageType DivergenceType;
typedef rtk::BackwardDifferenceDivergenceImageFilterGradientType::OutputImageType DivergenceType;
DivergenceType::Pointer div = DivergenceType::New();
div->SetInput(gradIm);
typedef itk::PeriodicBoundaryConditionGradientType::OutputImageType CVBoundaryType;
div->OverrideBoundaryCondition(new CVBoundaryType);
div->Update();
DivergenceType::OutputImageType::Pointer divIm = div->GetOutput();
std::cout << "Intensity Image" << std::endl;
DumpImage(im2);
DumpImage(gradIm);
DumpImage(divIm);
return 0;
}
from rtk.
Related Issues (20)
- Read Raw Data HOT 1
- how to use "DisplacedDetectorForOffsetFieldOfViewImageFilter"? HOT 1
- how itk.CudaImage convert to itk.Image? HOT 1
- Python Wrapping fails for missing dimensions HOT 15
- Why use SetTruncationCorrection in RTK has no performance? HOT 1
- Why SetTruncationCorrection(0.4) is not useful? HOT 3
- "Please, is there any source code available for this function?" HOT 1
- How to output the image after truncation correction and ramp filtering? HOT 1
- reconstruction by cuda occur problem: ITK ERROR: CUDA ERROR: out of memory HOT 1
- “itkRTK-5.2.lib” is not created HOT 1
- Unable to successfully build the rtk library HOT 2
- Reconstructed slices are returning as zeros and NaN HOT 1
- Unable to successfully build the rtk library HOT 2
- Error C1001 An internal error has occurred in the compiler. HOT 3
- Cuda memory error when using Cuda forward projector HOT 11
- Unable to debug hxx files and h files HOT 8
- Unable to compile simpleRTK HOT 1
- Installation issue with pip HOT 1
- why rtk::CudaFDKConeBeamReconstructionFilter's GetRampFilter()->SetTruncationCorrection() failed!
- why rtk::CudaFDKConeBeamReconstructionFilter's GetRampFilter()->SetTruncationCorrection() failed! HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rtk.