[ITK-users] Problems Using GPU Filters
Andaharoo
andx_roo at live.com
Thu Jun 29 22:19:36 EDT 2017
I've been looking to use some of the GPU filters provided by ITK recently.
Namely the GPU anisotropic filter and binary threshold filter. I downloaded
CUDA and ran cmake again with use gpu on flag and it found all my cuda stuff
automatically. Everything appeared to build fine. I then looked up some
implementation details and examples but couldn't really find any. There was
one itk powerpoint from a long while ago that seemed to suggest I'd be able
to just put a gpu filter in the pipeline like any other filter. I liked this
implementation but it didn't work. So right now I have a pipeline that looks
like the following in order to load images with vtk, process with itk, and
then render with vtk.
vtkToItkFilter -> array of ImageToImageFilters all connected ->
itkToVtkFilter
I tried to stick the GPUBinaryThresholdImageFilter in the array like I would
a normal filter connecting it appropriately and calling update but it broke
throwing a read access violation on line 46 of the GPUGenerateData function
in itkGPUUnaryFunctorImageFilter.hxx saying otPtr.m_Pointer was nullptr.
My code goes a little something like this:
typedef itk::Image<float, 3> Image;
typedef itk::GPUBinaryThresholdImageFilter<Image, Image>
GPUBinaryThresholdFilter;
GPUBinaryThresholdFilter::Pointer filter = GPUBinaryThresholdFilter::New();
double* range = pipe->GetOutput()->GetScalarRange();
filter->SetLowerThreshold(filterWidget->getDoubleFromSlider("Lower"));
filter->SetUpperThreshold(filterWidget->getDoubleFromSlider("Upper"));
filter->SetOutsideValue(range[0]);
filter->SetInsideValue(range[1]);
filters.push_back(filter);
if (filters.size() > 0)
filter->SetInput(filters.back()->GetOutput());
else
filter->SetInput(vtkToItkLoader->GetOutput());
itkToVtkFilter->SetInput(filters.back()->GetOutput());
--
View this message in context: http://itk-insight-users.2283740.n2.nabble.com/Problems-Using-GPU-Filters-tp7590036.html
Sent from the ITK Insight Users mailing list archive at Nabble.com.
More information about the Insight-users
mailing list