Hello Insight Users<br><br>I just started ITK and I have a problem using the ConnectedThresholdImageFilter, I have a big image volume as input and then when performing the update there is a memory allocation problem.<br><br>
Can some body help me with the procedure on how to execute the filter by regions (if possible)<br><br>A part of my code:<br><br>typedef ITKToVTKImageImport::itkImageType InternalImageType;<br> InternalImageType* image; <br>
InternalImageType* imageout;<br> typedef itk::ConnectedThresholdImageFilter< InternalImageType, InternalImageType > ConnectedFilterType;<br> ConnectedFilterType::Pointer connectedThreshold;<br>
InternalImageType::IndexType index;<br> itk::Vector<TypeImage, DIM> spc;<br><br> image = this->getITKImage(); <span style="color: rgb(255, 102, 102);">//Huge image input</span><br> connectedThreshold = ConnectedFilterType::New();<br>
connectedThreshold->SetInput( image );<br> connectedThreshold->SetLower( *_min );<br> connectedThreshold->SetUpper( *_max );<br> spc = image->GetSpacing();<br> <br> index[0] = (*_point)[0]*spc[0];<br>
index[1] = (*_point)[1]*spc[1];<br> index[2] = (*_point)[2]*spc[2];<br><br> connectedThreshold->SetSeed( index );<br> connectedThreshold->SetReplaceValue( 255 );<br> connectedThreshold->Update(); <span style="color: rgb(255, 0, 0);">//Throws exception indicating the memory allocation problem</span><br>
imageout = connectedThreshold->GetOutput();<br><br><br><br>Thank you very much<br>