[Insight-users] About SetFileName in for loop

Sergio Vera sergio.vera at alma3d.com
Tue Aug 3 05:05:48 EDT 2010


Hi Xiaopeng
this is more a general C++ question than itk, but I guess you can do
something like that:

(inside the loop)

std::stringstream filename;
filename << "D:\\fast_marching_simulation\\3D" << sigma<< ".dcm";
writer->SetFileName( filename.str() );


thus, adding each time the sigma value to the filename .


Hope it helps

Regards

On Tue, Aug 3, 2010 at 10:52 AM, Xiaopeng Yang <yxp233 at postech.ac.kr> wrote:

>  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
>
> _____________________________________
> 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
>
>


-- 
Sergio Vera

 Alma IT Systems
 C/ Vilana, 4B, 4º 1ª
 08022 Barcelona
 T. (+34) 932 380 592
 www.alma3d.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20100803/6d4f7526/attachment.htm>


More information about the Insight-users mailing list