[Insight-users] Problem with C++ fuctions

Miklos Espak espakm at gmail.com
Tue Sep 21 05:30:07 EDT 2010


Hi,

void fuction1(char inIM[],char outDT[]);
OutputImageType::Pointer fuction2(char outDT[]);
void fuction3(OutputImageType::Pointer outClean, char outSkel[]);

Cheers,
Miklos

On Tue, Sep 21, 2010 at 10:55 AM, Daniela Sacchetto
<danysunflower at hotmail.it> wrote:
> Hi everyone,
> I have a problem. I'm not expert in C++ but now I would like to improve my
> code using functions.
>
> I have a code that runs very well, but that code write every image and so, I
> have too much memory leak every times that I run it.
>
> I would like to save only two image, but the code uses 3 images to work.
>
> My code was:
>
>   function1(argv[1],argv[2]);
>
>   function2(argv[2],argv[3]);
>
>   function3(argv[3],argv[4]);
>
> where argv[] are the ImageFileNames. Now I would like to do something
> similar to:
>
> void fuction1(char inIM[],char outDT[]);
> OutputImageType fuction2(char outDT[]);
> void fuction3(char outClean[], char outSkel[]);
>
> [...]
>
> OutputImageType::Pointer outClean = OutputImageType::New();
> outClean->SetBufferedRegion( outClean->GetRequestedRegion() );
> outClean->Allocate();
>
>   fuction1(argv[1],argv[2]);
>
>   out2=function2(argv[2]);
>
>   fuction3(out2,argv[3]);
>
>
> My problem is that: I don't know how to obtain an image as a result of a
> fuction and then how to pass it to an other fuction.....
> Sorry for this banal question....
>
> Thanks
> Daniela
>
>
>
>
>
> _____________________________________
> 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.html
>
> 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