[Insight-users] muti-image threshold....

Chr. Rossmanith cr at neuro.ma.uni-heidelberg.de
Fri Jun 15 05:05:04 EDT 2012


Hi,

are the thresholds the same for all input images? Assuming that, you 
could do in a shell (i.e. where you usually execute filter6)

for i in inputfile*; do; ./filter6 $i ${i/input/output} lower-threshold 
upper-threshold; done

Here the shell is doing the loop for you - no need to implement it in 
your application.

Christina


Am 13.06.2012 16:19, schrieb Luke Hetrick:
> Hello,
>
>    I am running on a linux system. What I am really looking to do is 
> run an exectuable file that I created in ITK over a large data set of 
> pictures that are numbered from *22 to *680. THe executable I wrote is 
> just a simple threshold filter that takes the following arguments when 
> called:
>
>                                                 ./filter6 inputfile 
> outputfile lower-threshol upper-threshold
>
> and what I was hoping to do was have it loop through the images I have 
> running the same lower/upper-threshold values by just opening 
> inputfile022 to outputfile22 then opening inputfile23 and writing to 
> outputfile23...and so on. I have experience with C++ and Linux but I 
> am still a novice when it comes to most coding as you can see.
>
> Thank you for your help,
> Luke H
>
> On Wed, Jun 13, 2012 at 3:32 AM, Chr. Rossmanith 
> <cr at neuro.ma.uni-heidelberg.de <mailto:cr at neuro.ma.uni-heidelberg.de>> 
> wrote:
>
>     Hi,
>
>     what is your OS? Sounds like you are looking for a loop:
>
>     for i in [input file pattern]; do [YourAppName] $i `basename $i
>     [extension]`_proc.[extension]; done
>
>     where you would have to replace [input file pattern],
>     [YourAppName] and [extension] appropriately.
>
>     Christina
>     --
>     Dept. of Neurology
>     University Medical Center Mannheim
>
>
>     Am 12.06.2012 23:45, schrieb Luke Hetrick:
>>     Hey everyone,
>>
>>         I have a collection of roughly around 500 images and there is
>>     a lot of noise in the pictures that I can easily remove using the
>>     itkThresholdImageFilter. My question is, is there a way I can
>>     make the filter operate on the entire set of images instead of
>>     doing it a single image at a time? At the moment, the arguments I
>>     pass into the program that filters the image is just the
>>     filename, the output file name, the lower threshold, and the
>>     upper threshold. And this works great for a single image but I
>>     would hate to do this 500 times to clean up my data. Does anyone
>>     have an idea that I could try out?
>>
>>     Thanks so much for your help and time,
>>     Luke H
>>
>>
>>     _____________________________________
>>     Powered bywww.kitware.com  <http://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
>
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20120615/fff53897/attachment-0001.htm>


More information about the Insight-users mailing list