[Insight-users] About SetFileName in for loop

Qian Cheng qianc at ee.ethz.ch
Tue Aug 3 05:03:54 EDT 2010


I guess each time you should create a new instance of writer. Cause It's a pointer to a specific memory address, your loop will keep on rewriting into the same memory space, I'm afraid. Maybe I was wrong, but it's good to try it out.
Best wishes,
Cheng Qian

Sent from my HTC

----- Reply message -----
From: "Xiaopeng Yang" <yxp233 at postech.ac.kr>
Date: Tue, Aug 3, 2010 10:52
Subject: [Insight-users] About SetFileName in for loop
To: "'itk'" <Insight-users at itk.org>

Hi ITK users,

 

In the fast marching level set method, I tried to program a simulation
process for changing parameter "sigma" to get different outputs. Thus I
tried for loop. The problem is how to save the different results in
different file names. I think I need to change the code of "SetFileName". If
I do not change it, then the later result will replace the previous result
automatically. Anyone has any good idea? 

 

for (double sigma = 1.0; sigma <=1.4; sigma += .1) {

 

...

 

writer->SetFileName( "D:/fast_marching_simulation/3D.dcm" );

 

...

 

}

 

Thank you very much!

 

Xiaopeng

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20100803/6dc2123f/attachment.htm>


More information about the Insight-users mailing list