#ifndef __itkvHGWUtilities_txx #define __itkvHGWUtilities_txx #include "itkvHGWUtilities.h" #include "itkImageRegionConstIteratorWithIndex.h" #include "itkImageRegionConstIterator.h" #include "itkNeighborhoodAlgorithm.h" namespace itk { /** * \class vHGWUtilities * \brief functionality in common for vHGW openings/closings and * erosions/dilation * **/ #if 0 // this version doesn't allow the user to set border values template int fillLineBuffer(typename TImage::ConstPointer input, const typename TImage::IndexType StartIndex, const TLine line, // unit vector const float tol, const typename TBres::OffsetArray LineOffsets, const typename TImage::RegionType AllImage, const unsigned int KernLen, typename TImage::PixelType * pixbuffer, typename TImage::PixelType * fExtBuffer, unsigned &start, unsigned &end) { int status = computeStartEnd(StartIndex, line, tol, LineOffsets, AllImage, start, end); if (!status) return(status); unsigned size = end - start + 1; unsigned blocks = size/KernLen; unsigned i = 0; TFunction m_TF; // std::cout << "Line length = " << size << " KernSize = " << KernLen << " Blocks = " << blocks << std::endl; for (unsigned j = 0; j= (int)(blocks * KernLen)) { // std::cout << "r2: i = " << i << std::endl; typename TImage::PixelType V = pixbuffer[i]; rExtBuffer[i] = m_TF(V, rExtBuffer[i+1]); // if (m_TF(V, rExtBuffer[i+1])) // { // rExtBuffer[i] = V; // } // else // { // rExtBuffer[i] = rExtBuffer[i+1]; // } // std::cout << "r2: i = " << i << " " << (int) rExtBuffer[i] << std::endl; --i; } } for (unsigned j = 0; j