<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">
<div class="">Hello,</div>
<div class=""><br class="">
</div>
<div class="">In C++ ITK I would just use the CastImageFilter inplace to convert from RGBPixel to a vector type. But that doesn’t seemed to be wrapped:</div>
<div class=""><br class="">
</div>
<div class=""><a href="https://github.com/InsightSoftwareConsortium/ITK/blob/master/Modules/Filtering/ImageFilterBase/wrapping/itkCastImageFilter.wrap" class="">https://github.com/InsightSoftwareConsortium/ITK/blob/master/Modules/Filtering/ImageFilterBase/wrapping/itkCastImageFilter.wrap</a></div>
<div class=""><br class="">
</div>
<div class="">I would look into extending the pyBuffer to support the RGBPixel type:</div>
<div class=""><br class="">
</div>
<div class=""><a href="https://github.com/tobiasmaier/itkPyBuffer/blob/master/wrapping/itkPyBuffer.wrap" class="">https://github.com/tobiasmaier/itkPyBuffer/blob/master/wrapping/itkPyBuffer.wrap</a></div>
<div class=""><br class="">
</div>
<div class="">There should be some information documenting this in the ITK software guide:</div>
<div class=""><a href="https://itk.org/ITK/help/documentation.html" class="">https://itk.org/ITK/help/documentation.html</a></div>
<div class=""><br class="">
</div>
<div class="">HTH,</div>
<div class="">Brad</div>
<div class=""><br class="">
</div>
<div class="">
<div>
<blockquote type="cite" class="">
<div class="">On Jun 20, 2016, at 9:49 AM, Edwin Bennink <<a href="mailto:hebennink@gmail.com" class="">hebennink@gmail.com</a>> wrote:</div>
<br class="Apple-interchange-newline">
<div class="">
<div dir="ltr" class=""><span style="font-size:12.8px" class="">Hello,</span>
<div style="font-size:12.8px" class=""><br class="">
</div>
<div style="font-size:12.8px" class=""><br class="">
</div>
<div style="font-size:12.8px" class="">I am searching for a way to access pixel data of unsigned char RGBPixel images and complex float images in Numpy through PyBuffer.</div>
<div style="font-size:12.8px" class=""><br class="">
</div>
<div style="font-size:12.8px" class="">I guess that it should be possible to cast these images to a vector type and access the data without copying, but I can't figure out how. PyBuffer doesn't support RGB or complex images, and it feels stupid to decompose
 and recompose into a vector image.</div>
<div style="font-size:12.8px" class=""><br class="">
</div>
<div style="font-size:12.8px" class="">What would be a neat solution to this problem? Thanks!</div>
<div style="font-size:12.8px" class=""><br class="">
</div>
<div style="font-size:12.8px" class=""><br class="">
</div>
<div style="font-size:12.8px" class="">Edwin Bennink</div>
</div>
_____________________________________<br class="">
Powered by <a href="http://www.kitware.com" class="">www.kitware.com</a><br class="">
<br class="">
Visit other Kitware open-source projects at<br class="">
<a href="http://www.kitware.com/opensource/opensource.html" class="">http://www.kitware.com/opensource/opensource.html</a><br class="">
<br class="">
Kitware offers ITK Training Courses, for more information visit:<br class="">
http://www.kitware.com/products/protraining.php<br class="">
<br class="">
Please keep messages on-topic and check the ITK FAQ at:<br class="">
http://www.itk.org/Wiki/ITK_FAQ<br class="">
<br class="">
Follow this link to subscribe/unsubscribe:<br class="">
http://public.kitware.com/mailman/listinfo/insight-users<br class="">
_______________________________________________<br class="">
Community mailing list<br class="">
Community@itk.org<br class="">
http://public.kitware.com/mailman/listinfo/community<br class="">
</div>
</blockquote>
</div>
<br class="">
</div>
</body>
</html>