SCIRun User Mailing List

Text archives Help


Re: [SCIRUN-USERS] Help with Shell Scripting to run in Mac OS x Yosemite (10.10.5)


Chronological Thread 
  • From: Purbasha Garai <pg0222@gmail.com>
  • To: scirun-users@sci.utah.edu
  • Subject: Re: [SCIRUN-USERS] Help with Shell Scripting to run in Mac OS x Yosemite (10.10.5)
  • Date: Mon, 26 Oct 2015 12:32:18 -0400

Hello everyone, 

I am trying to set up a shell script to run a network (fem.srn) in scirun 

I basically have the following files: 
Input:

1) READFIELD: Mesh with conductivity values in it (.fld). 
2) READFIELD : Electrode position (.pts)

I have a series of files(.mat ) with conductivity values which needs to go in loop to get leadfield for each data set. 
The idea is to generate leadfield values for meshes with different conductivity values of each layer at a time. So, for one set of data, I am varying  conductivity value for one layer , keeping the values for other 4 layers constant. 

Output: Leadfield (Matlab .mat) : it should save leadfield for one mesh at a time and then rerun scirun.

This is the shell script I am using. Unfortunately, the SCIRUN app is not opening and I am not able to get the files in loop. I have added the folder containing scirun app in the PATH. Any help will be really appreciated. 

# check for inputs
if [ -z "2"]
then 
echo need at least two inputs
exit
fi

# list all files in input directory
fldfile=($(ls -1 $1/*.fld))


#run all fld files through scirun network
for l in ${fldfile[@]}
do

# print out file to run
echo -e "\n running file $l \n"

# run scirun network output files save automatically
scirun -E fem2.srn + FLDFILE=$l + PTSFILE=$2

done

# check for result directory, move output files to that directory.
if [ $3 ]
then


echo moving results to $3

mv $1/*simulation.mat $3
fi



Thank you so much
Regards

Regards
Purbasha

On 26 October 2015 at 12:23, Purbasha Garai <pg0222@gmail.com> wrote:
Hello everyone, 

I am trying to set up a shell script to run a network (fem.srn) in scirun 

I basically have the following files: 
Input:

1) READFIELD 1: Mesh with conductivity values in it (.fld). 
2) READFIELD 2: Electrode position (.pts)

T
The idea is to generate leadfield values for meshes with different conductivity values of each layer at a time. So, for one set of data, I am varying  conductivity value for one layer , keeping the values for other 4 layers constant. 
Output: Leadfield (Matlab .mat) : it should save leadfield for one mesh at a time and then rerun scirun.
For now, I am using the fem.srn file to generate the leadfield using one ring at a time.

I am using windows operating system which uses .bat files. In the "defib evaluation folder", the bash scripting is for linux or for mac (.sh file). I re-wrote the script looking at the sxample you have provided, but I am not sure if its correct. 

Thank you so much
Regards
Purbasha




Archive powered by MHonArc 2.6.18.

Top of page