11.07.2015 Views

Using Scripts - mipav

Using Scripts - mipav

Using Scripts - mipav

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

M I P A VM e d i c a l I m a g e P r o c e s s i n g, A n a l y s i s, & V i s u a l i z a t i o nMIPAV User’s Guide, Volume 1, Basicswrite a batch file to load a levelset VOI into an image.@echo offrem -- %1 is the full path to the image file, though notrem -- the file itself; we assume there to be a *01.dcmrem -- file to exist in this directory.rem -- VOI is assumed to be in the same directory with namerem -- levelset1.xml./<strong>mipav</strong> -i %1\*01.dcm -v %1\levelset1.xmlMore efficient and more useful, starting MIPAV with multiple images iseasily done in a simple script. Here is how it is done in BASH:#! /bin/bash# argument 1 is the file (with wild-cards) we want to open# arg 1 must be escaped (with quotes) to allow the shell to send# the wildcards unmolested to the script. Otherwise, the shell# will try to expand the shorthand. This has a different effect.LISTING=`ls $1` # Generate the file listingMIPARGS=# For each file in the listing, prepend it with '-i' and# the filename, then follow it with all the previous# files.for FS in $LISTING;doMIPARGS=" -i $FS $MIPARGS";done# start MIPAV:./<strong>mipav</strong> $MIPARGSAlthough this script doesn’t include the line ./<strong>mipav</strong> $MIPARGS with a “&”to run MIPAV in the background, it could have. This would have the effectof exiting the script with MIPAV in the background; as it is, the script doesnot exit—and return control to you at the command line—until MIPAVexits.MIPAV User’s Guide, Volume 1, Basics 53212/2/08

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!