c++ - Writing ITK (insight Toolkit) results to local buffer -
c++ - Writing ITK (insight Toolkit) results to local buffer -
after applying itk filter pipeline, how write result buffer used (outside itk)?
the insight software guide has illustration book 1: chapter 4.1.7: "importing image info buffer", , same illustration found in wikiexamples.
it shows how 1 can wrap itk pointer around c++ array utilize farther using importimagefilter
object. however, illustration uses writer
object write filtered result file.
how write filtered result c++ array instead? or how overwrite array i've used input?
in essence, i've application contains image in buffer (localbuffer
) can wrap next illustration code:
[...] const bool filterownsbuffer= false; importfilter->setimportpointer( localbuffer, size[0]*size[1], filterownsbuffer );
i can utilize it in itk pipeline , 'update' @ stage:
[...] filtertype::pointer filter = filtertype::new(); filter->setinput( importfilter->getoutput() ); filter->update();
how ensure localbuffer
has filtered values? or, alternatively, how set different resultbuffer
output values? have utilize image iterator , 'loop' on buffer manually? or can utilize filter->getoutput()
more directly?
a little code illustration or link according illustration much appreciated. (simply "exporting image info buffer" equivalent given import example.)
imagetype::pointer output = filter->getoutput(); imagetype::pixelcontainer * outputcontainer = output->getpixelcontainer(); imagetype::pixelcontainer::element * resultbuffer = outputcontainer->getbufferpointer();
see image documentation , importimagecontainer documentation.
c++ itk
Comments
Post a Comment