The fastest way to “convert” the image, is not to do any work and just get a pointer to the buffer. ![]() Every itk::Image has one of these object to hold the buffer. You want to look at the ImportImageContainer. On at 09:55, Lowekamp, Bradley (NIH/NLM/LHC) wrote: Ideally, I would like to use a single multi-threaded filter which takes a mask as input along with the mask and extracts pixel values as a vector in return. I have tried both the solutions presented and neither work as optimally as I would like. Pass trainingData to classifier of choice. Concatenate multiple tempColMat/tempRowMat - trainingDataĥ. Vectorize the inputImage in the region defined by inputMask - tempColMat or tempRowMatĤ. Generate a mask to remove background information (either using Otsu or reading another image with this information) - inputMaskģ. ![]() Objet: Re: Vectorize/Linearize itk::Image That would be less hassle than a full mask image. On a side note, if you're only interested in intensities as output, and willing to discard the correspondance between position and value, why not just compute the otsu threshold, then parse the buffer, adding the value to your vector when it's over/under this threshold (depending on what you consider as background)? If you want to hide all the processing code you may want to write your own filter. That's not really a generic framework so I doubt you will find a ready-to-use filter to do that.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |