<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Tahoma
}
--></style>
</head>
<body class='hmmessage'>
Hi everyone,<br>I have a problem. I'm not expert in C++ but now I would like to improve my code using functions.<br><br>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.<br><br>I would like to save only two image, but the code uses 3 images to work.<br><br>My code was:<br><br> function1(argv[1],argv[2]); <br> <br> function2(argv[2],argv[3]);<br><br> function3(argv[3],argv[4]);<br><br>where argv[] are the ImageFileNames. Now I would like to do something similar to:<br><br>void fuction1(char inIM[],char outDT[]);<br>
OutputImageType fuction2(char outDT[]);<br>
void fuction3(char outClean[], char outSkel[]);<br><br>[...]<br><br>OutputImageType::Pointer outClean = OutputImageType::New();<br>outClean->SetBufferedRegion( outClean->GetRequestedRegion() );<br>outClean->Allocate();<br> <br> fuction1(argv[1],argv[2]); <br> <br> out2=function2(argv[2]);<br><br> fuction3(out2,argv[3]);<br><br><br>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.....<br>Sorry for this banal question....<br><br>Thanks<br>Daniela<br><br><br><br><br>                                            </body>
</html>