[Insight-users] Problem grafting a C++ array as an ImageToImageFilter output

Matt McCormick matt.mccormick at kitware.com
Fri Aug 9 11:54:26 EDT 2013


Hi Ramon,

More information on the ITK software process can be found here [1].
Your contributions to the project are welcome.

Other community members would probably be interested in your
MatlabExportFilter; a good way to expose your good work is through the
Insight Journal [2].

Thanks,
Matt

[1] http://insightsoftwareconsortium.github.io/ITKBarCamp-doc/CommunitySoftwareProcess/index.html
[2] http://insight-journal.org/


On Fri, Aug 9, 2013 at 12:31 PM, Ramón Casero Cañas <rcasero at gmail.com> wrote:
> Hi, sorry for the very slow reply.
>
> On 30 May 2013 13:41, Bradley Lowekamp <blowekamp at mail.nih.gov> wrote:
>>
>> Hello,
>>
>> There a many options to choose from to minimize memory. Some filter run
>> in-place, and re-use the input buffer on the output.
>>
>> Can you use the image buffer from ITK and import it into matlab? Does
>> matlab not have the ability to import a buffer?
>
>
> Not as far as I know. I think the main problem is that once the mex function
> runs, everything that has not been allocated with a MEX API function, e.g.
>
> http://www.mathworks.co.uk/help/matlab/apiref/mxcreatenumericarray.html
>
> will be destroyed. You can create the Matlab array, get a pointer to it, and
> then copy over the content of the ITK buffer, but that's as good as you can
> do.
>
>>
>>
>> As Matt said this behavior that you are expecting is not required, and as
>> I mentioned above sometimes not do able. However, based on the code you
>> provided, it should be possible to modify this filter to do the correct
>> grafting. If you create a patch, which adds to the exiting test for this
>> filter this behavior, then submit it to gerrit, it would make it easier for
>> someone to modify the filter to the desired behavior.
>>
>
>
> I'm happy to do this, but I have no idea where to start.
>
> What I have done is write method to copy ITK filters to Matlab in our
> MatlabExportFilter, and share it here
>
> https://code.google.com/p/gerardus/source/browse/trunk/matlab/MatlabExportFilter.h?r=1298#119
>
> Best regards,
>
> Ramon.
>
> --
> Dr. Ramón Casero Cañas
>
> Oxford e-Research Centre (OeRC)
> University of Oxford
> 7 Keble Rd
> Oxford OX1 3QG
>
> tlf     +44 (0) 1865 610739
> web     http://www.cs.ox.ac.uk/people/Ramon.CaseroCanas
> photos  http://www.flickr.com/photos/rcasero/
>
> _____________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Kitware offers ITK Training Courses, for more information visit:
> http://www.kitware.com/products/protraining.php
>
> Please keep messages on-topic and check the ITK FAQ at:
> http://www.itk.org/Wiki/ITK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.itk.org/mailman/listinfo/insight-users
>


More information about the Insight-users mailing list