Skip to content

Commit

Permalink
Pretty scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
billkarsh committed Jul 8, 2013
1 parent a6bccb7 commit e461f90
Show file tree
Hide file tree
Showing 38 changed files with 175 additions and 63 deletions.
1 change: 0 additions & 1 deletion 00_ENV/getsharedbins.sht
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,3 @@
cp /groups/apig/share/ClusterSupport/bins/SuperLUSymSolve /groups/apig/tomo/lou_stuff/binaries
cp /groups/apig/share/ClusterSupport/bins/SuperLUSymSolveMPI /groups/apig/tomo/lou_stuff/binaries


1 change: 0 additions & 1 deletion 1_Ptestx/findsame.sht
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,3 @@
grep -e "ptest 30/30021022@30/30022023" S*/make.same



File renamed without changes.
4 changes: 0 additions & 4 deletions 2_GraRan1Lyr/driver.sht

This file was deleted.

17 changes: 17 additions & 0 deletions 2_GraRan1Lyr/gr1go.sht
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/sh

# Purpose:
# Write entry in outfile GRScales.txt having scale min,max for this layer.
#
# > GraRan1Lyr <xml-file> -z=i <-chn=chn> <-pct-pct> [options].
#
# Required:
# -chn=0 ;for example, scale channel 0
# -pct=85.0 ;for example, use 85% of forground range.
#
# Options:
# -lrbt=0,0,-1,-1 ;calculate average intensity in this ROI


GraRan1Lyr layer0_48_grn_sim_montage.xml -z=2 -chn=0 -pct=50.0

8 changes: 3 additions & 5 deletions 2_GrayRanger/GrayRanger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,8 @@ static void WriteScript( vector<int> &zlist )

int nz = zlist.size();

fprintf( f, "#!/bin/sh\n\n" );
fprintf( f, "#!/bin/sh\n" );
fprintf( f, "\n" );

for( int iz = 0; iz < nz; ++iz ) {

Expand All @@ -200,10 +201,7 @@ static void WriteScript( vector<int> &zlist )
fprintf( f, "\n" );

fclose( f );

// make executable

chmod( "make.scales.sht", S_IRWXU | S_IRWXG | S_IRWXO );
FileScriptPerms( "make.scales.sht" );
}

/* --------------------------------------------------------------- */
Expand Down
4 changes: 0 additions & 4 deletions 2_GrayRanger/driver.sht

This file was deleted.

17 changes: 17 additions & 0 deletions 2_GrayRanger/grgo.sht
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/sh

# Purpose:
# Create script 'make.scales.sht' to submit GraRan1Lyr jobs.
#
# > GrayRanger <xml-file> -zmin=i -zmax=j <-chn=chn> <-pct-pct> [options].
#
# Required:
# -chn=0 ;for example, scale channel 0
# -pct=85.0 ;for example, use 85% of forground range.
#
# Options:
# -lrbt=0,0,-1,-1 ;calculate average intensity in this ROI


GrayRanger layer0_48_grn_sim_montage.xml -zmin=2 -zmax=2 -chn=0 -pct=50.0

8 changes: 3 additions & 5 deletions 2_HEQLayers/HEQLayers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,8 @@ static void WriteScript( vector<int> &zlist )

int nz = zlist.size();

fprintf( f, "#!/bin/sh\n\n" );
fprintf( f, "#!/bin/sh\n" );
fprintf( f, "\n" );

for( int iz = 0; iz < nz; ++iz ) {

Expand All @@ -199,10 +200,7 @@ static void WriteScript( vector<int> &zlist )
fprintf( f, "\n" );

fclose( f );

// make executable

chmod( "make.heq.sht", S_IRWXU | S_IRWXG | S_IRWXO );
FileScriptPerms( "make.heq.sht" );
}

/* --------------------------------------------------------------- */
Expand Down
17 changes: 17 additions & 0 deletions 2_HEQLayers/heqlayersgo.sht
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/sh

# Purpose:
# Create script 'make.heq.sht' to submit HEQ1Lyr jobs.
#
# > HEQLayers <xml-file> <tag> -zmin=i -zmax=j <-pct=pct> [options].
#
# Required:
# tag ;text string like HEQ that labels output folder and tifs.
# -pct=85.0 ;for example, use 85% of forground range.
#
# Options:
# -lrbt=0,0,-1,-1 ;calculate average intensity in this ROI


HEQLayers layer0_48_grn_sim_montage.xml HEQ -zmin=0 -zmax=48 -pct=99.5

21 changes: 21 additions & 0 deletions 2_HEQVFY/heqvfygo.sht
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/sh

# Purpose:
# List missing HEQ files.
#
# The input XML file can have either native or tag-modified file-paths.
# In either case, we call DskExists for each image. We do not check
# correctness of the XML file itself.
#
# > HEQVFY <xml-file> <tag> [options]
#
# Required:
# tag ;text string like HEQ that labels output folder and tifs.
#
# Options:
# -p=_N_ ;pattern describes context around tile ID 'N' in img name
# -zmin=i -zmax=j ;restricts layer range


HEQVFY Z7-119.txt HEQ -zmin=7 -zmax=119

17 changes: 17 additions & 0 deletions 2_HEQXML/heqxmlgo.sht
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/sh

# Purpose:
# Using same tag and Z-range as for HEQLayers, update corresponding XML
# to point to the new images.
#
# > HEQXML <xml-file> <tag> [options]
#
# Required:
# tag ;text string like HEQ that labels output folder and tifs.
#
# Options:
# -zmin=i -zmax=j ;restricts layer range


HEQXML Z7-119.txt HEQ -zmin=7 -zmax=119

2 changes: 1 addition & 1 deletion 2_Hist1/Hist1.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ void CArgs_hist1::SetCmdLine( int argc, char* argv[] )
// parse command line args

if( argc < 3 ) {
printf( "Usage: Hist1 <img-file> <hst_file> [options].\n" );
printf( "Usage: Hist1 <img-file> <hst_file>.\n" );
exit( 42 );
}

Expand Down
9 changes: 9 additions & 0 deletions 2_Hist1/driver.sht → 2_Hist1/hst1go.sht
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
#!/bin/sh

# Purpose:
# Write binary histogram file for one 16-bit image.
#
# > Hist1 <img-file> <hst-file>.
#
# Options:
# none


mkdir HST
cd HST

Expand Down
10 changes: 4 additions & 6 deletions 2_HistAll/HistAll.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ void CArgs_hsta::SetCmdLine( int argc, char* argv[] )
// parse command line args

if( argc < 3 ) {
printf( "Usage: HistAll <xml-file> -chan=,, [options].\n" );
printf( "Usage: HistAll <xml-file> -chan=,,.\n" );
exit( 42 );
}

Expand Down Expand Up @@ -212,7 +212,8 @@ static void WriteScript( const vector<Picture> &vp )
int np = vp.size(),
nc = gArgs.chn.size();

fprintf( f, "#!/bin/sh\n\n" );
fprintf( f, "#!/bin/sh\n" );
fprintf( f, "\n" );

for( int ip = 0; ip < np; ++ip ) {

Expand All @@ -233,10 +234,7 @@ static void WriteScript( const vector<Picture> &vp )
fprintf( f, "\n" );

fclose( f );

// make executable

chmod( "HST/make.hst.sht", S_IRWXU | S_IRWXG | S_IRWXO );
FileScriptPerms( "HST/make.hst.sht" );
}

/* --------------------------------------------------------------- */
Expand Down
4 changes: 0 additions & 4 deletions 2_HistAll/driver.sht

This file was deleted.

16 changes: 16 additions & 0 deletions 2_HistAll/hstgo.sht
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/sh

# Purpose:
# Create 'HST' directory and script 'HST/make.hst.sht' to submit Hist1 jobs.
#
# > HistAll <xml-file> -zmin=i -zmax=j <-chan=,,>.
#
# Required:
# -chan=1,3 ;e.g., write histogram files for channels 1 and 3.
#
# Options:
# none


HistAll layer0_48_grn_sim_montage.xml -zmin=2 -zmax=2 -chan=1,2

6 changes: 0 additions & 6 deletions 2_RGBM1Lyr/driver.sht

This file was deleted.

18 changes: 18 additions & 0 deletions 2_RGBM1Lyr/rgb1go.sht
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/sh

# Purpose:
# For one layer, create new folder TIF_tag and create scaled images there.
#
# > RGBM1Lyr <xml-file> <tag> -z=i <-[R,G,B]=i,pct> [options].
#
# Required:
# tag ;text string like RGB that labels output folder and tifs.
# -R=0,85.0 ;for example, color channel-0 red using 85% of forground range.
#
# Options:
# -spanRGB=LLL ;three-char string like LTT specifies scaling by {L=whole layer, T=ea. tile}
# -lrbt=0,0,-1,-1 ;calculate average intensity in this ROI


RGBM1Lyr layer0_48_grn_sim_montage.xml RGB -z=0 -R=1,99.5 -G=0,99.5 -B=2,99.5

8 changes: 3 additions & 5 deletions 2_RGBMerge/RGBMerge.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,8 @@ static void WriteScript( vector<int> &zlist )

int nz = zlist.size();

fprintf( f, "#!/bin/sh\n\n" );
fprintf( f, "#!/bin/sh\n" );
fprintf( f, "\n" );

for( int iz = 0; iz < nz; ++iz ) {

Expand All @@ -257,10 +258,7 @@ static void WriteScript( vector<int> &zlist )
fprintf( f, "\n" );

fclose( f );

// make executable

chmod( "make.merge.sht", S_IRWXU | S_IRWXG | S_IRWXO );
FileScriptPerms( "make.merge.sht" );
}

/* --------------------------------------------------------------- */
Expand Down
6 changes: 0 additions & 6 deletions 2_RGBMerge/driver.sht

This file was deleted.

18 changes: 18 additions & 0 deletions 2_RGBMerge/rgbgo.sht
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/sh

# Purpose:
# Create script 'make.merge.sht' to submit RGB1Lyr jobs.
#
# > RGBMerge <xml-file> <tag> -zmin=i -zmax=j <-[R,G,B]=i,pct> [options].
#
# Required:
# tag ;text string like RGB that labels output folder and tifs.
# -R=0,85.0 ;for example, color channel-0 red using 85% of forground range.
#
# Options:
# -spanRGB=LLL ;three-char string like LTT specifies scaling by {L=whole layer, T=ea. tile}
# -lrbt=0,0,-1,-1 ;calculate average intensity in this ROI


RGBMerge layer0_48_grn_sim_montage.xml RGB -zmin=0 -zmax=48 -R=1,99.5 -G=0,99.5 -B=2,99.5

2 changes: 1 addition & 1 deletion macros/CLEAN.sht
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# Clean work files from older Lou-style temp structure
#


rm lou-*
rm *.log
rm *.tif
Expand All @@ -14,4 +15,3 @@ rm qual.*
rm ./*/*map*
rm ./*/*tf*


2 changes: 1 addition & 1 deletion macros/JuanLayout.sht
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

# Build rick file for juan


rm layout.txt

for i in $(seq 0 99)
Expand All @@ -13,4 +14,3 @@ done

rm temp.txt


1 change: 1 addition & 0 deletions macros/ReplaceAll.sht
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/bin/sh


searchterm="Plate1_0/fixed_images"
replaceterm="Plate1_0/TIF"
inwhich="*.xml"
Expand Down
2 changes: 1 addition & 1 deletion macros/catlayout.sht
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# Concatenate Rick files for individual dirs into one big file
#


dir=/groups/bock/bocklab/eric/forbill/cutout1

for i in $(seq 0 60)
Expand All @@ -14,4 +15,3 @@ do
fi
done


2 changes: 1 addition & 1 deletion macros/catlyr.sht
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# Concatenate Rick files for individual dirs into one big file
#


dir=/groups/bock/bocklab/people/eric/scratch/32stack-clahe/

for z in $(seq 7 119)
Expand All @@ -11,4 +12,3 @@ do
cat $dir$N".txt" >> Z7-119.txt
done


2 changes: 0 additions & 2 deletions macros/edit_filepath.sht
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#!/bin/sh


# This script edits the file_path tags in TrakEM2 xml files.
# It does simple substitutions at the start of the paths.
#
Expand Down Expand Up @@ -64,4 +63,3 @@ fi
# Do substitutions on all lines
sed 's|file_path="'$old'|file_path="'$new'|' < $1 > $v2


2 changes: 0 additions & 2 deletions macros/edit_title.sht
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#!/bin/sh


# This script edits the title tags in TrakEM2 xml files,
# to change from one channel specifier to another. The
# image names are expected to look like B7_15_channel,
Expand Down Expand Up @@ -43,4 +42,3 @@ fi
# Do substitutions on all lines
sed 's|title="\(.*_[0-9]\{1,\}_\)'$old'|title="\1'$new'|' < $1 > $v2


Loading

0 comments on commit e461f90

Please sign in to comment.