#!/bin/csh

#bev_void_all.csh
#Make color STL file for each void grain, and make bird's eye view maps/movie

set dir0=obs_fin			#input file name

set vg=b24				#name of void grain
set scale=5				#scale for bird's eye view map


set dir=051120b
set area=(1062 805 209 1072 819 219)	#(x0 y0 z0 x1 y1 z1) for cut
set color=(0 128 255)		#color for stl file
set cn=CB				#Cyan-Blue

echo $dir
cd C:/bubbling/$dir

echo CUT area, SELECT void grain, and MAKE STL file

mkdir cut
sliceIT $dir0 - $area cut
mkdir ${vg}_MCL
sliceMCL cut - 0 0 ${vg}_MCL >${vg}_MCL.xls
si_stl_B ${vg}_MCL - 1 1 ${vg}.stl
stl_color ${vg}.stl $color ${vg}_${cn}.stl

echo MAKE  Bierds Eye View Images and Movie

stl_bev_C_SS ${vg}_${cn}.stl $scale 1 16 255 255 255 0 0 0 0 0 0 <<fin
0 0 ${vg}+X.tif
90 0 ${vg}+Y.tif
0 90 ${vg}+Z.tif
0 -90 ${vg}-Z.tif
60 -20 ${vg}_60_-20.tif
-120 20 ${vg}_-120_20.tif
fin

stl_bev_C_GIF_SS  ${vg}_${cn}.stl $scale 1 16 255 255 255 0 0 0 0 0 0 ${vg}.gif <<fin
0 0 0 2 100
0 200 2 0 180
0 200 0 2 80
fin

rm -r cut


set dir=051120c
set area=(1064 789 201 1079 807 216)	#(x0 y0 z0 x1 y1 z1) for cut
set color=(0 255 0)			#color for stl file
set cn=G				#Green

echo $dir
cd C:/bubbling/$dir

echo CUT area, SELECT void grain, and MAKE STL file

mkdir cut
sliceIT $dir0 - $area cut
mkdir ${vg}_MCL
sliceMCL cut - 0 0 ${vg}_MCL >${vg}_MCL.xls
si_stl_B ${vg}_MCL - 1 1 ${vg}.stl
stl_color ${vg}.stl $color ${vg}_${cn}.stl

echo MAKE  Bierds Eye View Images and Movie

stl_bev_C_SS ${vg}_${cn}.stl $scale 1 16 255 255 255 0 0 0 0 0 0 <<fin
0 0 ${vg}+X.tif
90 0 ${vg}+Y.tif
0 90 ${vg}+Z.tif
0 -90 ${vg}-Z.tif
60 -20 ${vg}_60_-20.tif
-120 20 ${vg}_-120_20.tif
fin

stl_bev_C_GIF_SS  ${vg}_${cn}.stl $scale 1 16 255 255 255 0 0 0 0 0 0 ${vg}.gif <<fin
0 0 0 2 100
0 200 2 0 180
0 200 0 2 80
fin

rm -r cut


set dir=051120d
set area=(1047 779 194 1069 803 219)	#(x0 y0 z0 x1 y1 z1) for cut
set color=(255 0 128)		#color for stl file
set cn=MR				#Magenta-Red

echo $dir
cd C:/bubbling/$dir

echo CUT area, SELECT void grain, and MAKE STL file

mkdir cut
sliceIT $dir0 - $area cut
mkdir ${vg}_MCL
sliceMCL cut - 0 0 ${vg}_MCL >${vg}_MCL.xls
si_stl_B ${vg}_MCL - 1 1 ${vg}.stl
stl_color ${vg}.stl $color ${vg}_${cn}.stl

echo MAKE  Bierds Eye View Images and Movie

stl_bev_C_SS ${vg}_${cn}.stl $scale 1 16 255 255 255 0 0 0 0 0 0 <<fin
0 0 ${vg}+X.tif
90 0 ${vg}+Y.tif
0 90 ${vg}+Z.tif
0 -90 ${vg}-Z.tif
60 -20 ${vg}_60_-20.tif
-120 20 ${vg}_-120_20.tif
fin

stl_bev_C_GIF_SS  ${vg}_${cn}.stl $scale 1 16 255 255 255 0 0 0 0 0 0 ${vg}.gif <<fin
0 0 0 2 100
0 200 2 0 180
0 200 0 2 80
fin

rm -r cut


set dir=051120e
set area=(1033 768 186 1060 797 217)	#(x0 y0 z0 x1 y1 z1) for cut
set color=(0 0 255)			#color for stl file
set cn=B				#Blue

echo $dir
cd C:/bubbling/$dir

echo CUT area, SELECT void grain, and MAKE STL file

mkdir cut
sliceIT $dir0 - $area cut
mkdir ${vg}_MCL
sliceMCL cut - 0 0 ${vg}_MCL >${vg}_MCL.xls
si_stl_B ${vg}_MCL - 1 1 ${vg}.stl
stl_color ${vg}.stl $color ${vg}_${cn}.stl

echo MAKE  Bierds Eye View Images and Movie

stl_bev_C_SS ${vg}_${cn}.stl $scale 1 16 255 255 255 0 0 0 0 0 0 <<fin
0 0 ${vg}+X.tif
90 0 ${vg}+Y.tif
0 90 ${vg}+Z.tif
0 -90 ${vg}-Z.tif
60 -20 ${vg}_60_-20.tif
-120 20 ${vg}_-120_20.tif
fin

stl_bev_C_GIF_SS  ${vg}_${cn}.stl $scale 1 16 255 255 255 0 0 0 0 0 0 ${vg}.gif <<fin
0 0 0 2 100
0 200 2 0 180
0 200 0 2 80
fin

rm -r cut


set dir=051120f
set area=(1026 767 176 1062 805 216)	#(x0 y0 z0 x1 y1 z1) for cut
set color=(255 128 0)		#color for stl file
set cn=YR				#Yellow-Red (Orange)

echo $dir
cd C:/bubbling/$dir

echo CUT area, SELECT void grain, and MAKE STL file

mkdir cut
sliceIT $dir0 - $area cut
mkdir ${vg}_MCL
sliceMCL cut - 0 0 ${vg}_MCL >${vg}_MCL.xls
si_stl_B ${vg}_MCL - 1 1 ${vg}.stl
stl_color ${vg}.stl $color ${vg}_${cn}.stl

echo MAKE  Bierds Eye View Images and Movie

stl_bev_C_SS ${vg}_${cn}.stl $scale 1 16 255 255 255 0 0 0 0 0 0 <<fin
0 0 ${vg}+X.tif
90 0 ${vg}+Y.tif
0 90 ${vg}+Z.tif
0 -90 ${vg}-Z.tif
60 -20 ${vg}_60_-20.tif
-120 20 ${vg}_-120_20.tif
fin

stl_bev_C_GIF_SS  ${vg}_${cn}.stl $scale 1 16 255 255 255 0 0 0 0 0 0 ${vg}.gif <<fin
0 0 0 2 100
0 200 2 0 180
0 200 0 2 80
fin

rm -r cut


set dir=051120g
set area=(1024 755 164 1069 801 212)	#(x0 y0 z0 x1 y1 z1) for cut
set color=(0 255 255)		#color for stl file
set cn=C				#Cyan

echo $dir
cd C:/bubbling/$dir

echo CUT area, SELECT void grain, and MAKE STL file

mkdir cut
sliceIT $dir0 - $area cut
mkdir ${vg}_MCL
sliceMCL cut - 0 0 ${vg}_MCL >${vg}_MCL.xls
si_stl_B ${vg}_MCL - 1 1 ${vg}.stl
stl_color ${vg}.stl $color ${vg}_${cn}.stl

echo MAKE  Bierds Eye View Images and Movie

stl_bev_C_SS ${vg}_${cn}.stl $scale 1 16 255 255 255 0 0 0 0 0 0 <<fin
0 0 ${vg}+X.tif
90 0 ${vg}+Y.tif
0 90 ${vg}+Z.tif
0 -90 ${vg}-Z.tif
60 -20 ${vg}_60_-20.tif
-120 20 ${vg}_-120_20.tif
fin

stl_bev_C_GIF_SS  ${vg}_${cn}.stl $scale 1 16 255 255 255 0 0 0 0 0 0 ${vg}.gif <<fin
0 0 0 2 100
0 200 2 0 180
0 200 0 2 80
fin

rm -r cut


set dir=051120h
set area=(1019 748 151 1072 803 207)	#(x0 y0 z0 x1 y1 z1) for cut
set color=(128 255 0)		#color for stl file
set cn=YG				#Yellow-Green

echo $dir
cd C:/bubbling/$dir

echo CUT area, SELECT void grain, and MAKE STL file

mkdir cut
sliceIT $dir0 - $area cut
mkdir ${vg}_MCL
sliceMCL cut - 0 0 ${vg}_MCL >${vg}_MCL.xls
si_stl_B ${vg}_MCL - 1 1 ${vg}.stl
stl_color ${vg}.stl $color ${vg}_${cn}.stl

echo MAKE  Bierds Eye View Images and Movie

stl_bev_C_SS ${vg}_${cn}.stl $scale 1 16 255 255 255 0 0 0 0 0 0 <<fin
0 0 ${vg}+X.tif
90 0 ${vg}+Y.tif
0 90 ${vg}+Z.tif
0 -90 ${vg}-Z.tif
60 -20 ${vg}_60_-20.tif
-120 20 ${vg}_-120_20.tif
fin

stl_bev_C_GIF_SS  ${vg}_${cn}.stl $scale 1 16 255 255 255 0 0 0 0 0 0 ${vg}.gif <<fin
0 0 0 2 100
0 200 2 0 180
0 200 0 2 80
fin

rm -r cut


set dir=051120i
set area=(1018 727 176 1080 790 245)	#(x0 y0 z0 x1 y1 z1) for cut
set color=(255 0 255)		#color for stl file
set cn=M				#Magenta

echo $dir
cd C:/bubbling/$dir

echo CUT area, SELECT void grain, and MAKE STL file

mkdir cut
sliceIT $dir0 - $area cut
mkdir ${vg}_MCL
sliceMCL cut - 0 0 ${vg}_MCL >${vg}_MCL.xls
si_stl_B ${vg}_MCL - 1 1 ${vg}.stl
stl_color ${vg}.stl $color ${vg}_${cn}.stl

echo MAKE  Bierds Eye View Images and Movie

stl_bev_C_SS ${vg}_${cn}.stl $scale 1 16 255 255 255 0 0 0 0 0 0 <<fin
0 0 ${vg}+X.tif
90 0 ${vg}+Y.tif
0 90 ${vg}+Z.tif
0 -90 ${vg}-Z.tif
60 -20 ${vg}_60_-20.tif
-120 20 ${vg}_-120_20.tif
fin

stl_bev_C_GIF_SS  ${vg}_${cn}.stl $scale 1 16 255 255 255 0 0 0 0 0 0 ${vg}.gif <<fin
0 0 0 2 100
0 200 2 0 180
0 200 0 2 80
fin

rm -r cut


set dir=051120jk
set area=(1005 758 238 1073 827 316)	#(x0 y0 z0 x1 y1 z1) for cut
set color=(0 255 128)		#color for stl file
set cn=CG				#Cyan-Green

echo $dir
cd C:/bubbling/$dir

echo CUT area, SELECT void grain, and MAKE STL file

mkdir cut
sliceIT $dir0 - $area cut
mkdir ${vg}_MCL
sliceMCL cut - 0 0 ${vg}_MCL >${vg}_MCL.xls
si_stl_B ${vg}_MCL - 1 1 ${vg}.stl
stl_color ${vg}.stl $color ${vg}_${cn}.stl

echo MAKE  Bierds Eye View Images and Movie

stl_bev_C_SS ${vg}_${cn}.stl $scale 1 16 255 255 255 0 0 0 0 0 0 <<fin
0 0 ${vg}+X.tif
90 0 ${vg}+Y.tif
0 90 ${vg}+Z.tif
0 -90 ${vg}-Z.tif
60 -20 ${vg}_60_-20.tif
-120 20 ${vg}_-120_20.tif
fin

stl_bev_C_GIF_SS  ${vg}_${cn}.stl $scale 1 16 255 255 255 0 0 0 0 0 0 ${vg}.gif <<fin
0 0 0 2 100
0 200 2 0 180
0 200 0 2 80
fin

rm -r cut


set dir=051120lm
set area=(1033 775 285 1102 848 375)	#(x0 y0 z0 x1 y1 z1) for cut
set color=(255 255 0)		#color for stl file
set cn=Y				#Yelow

echo $dir
cd C:/bubbling/$dir

echo CUT area, SELECT void grain, and MAKE STL file

mkdir cut
sliceIT $dir0 - $area cut
mkdir ${vg}_MCL
sliceMCL cut - 0 0 ${vg}_MCL >${vg}_MCL.xls
si_stl_B ${vg}_MCL - 1 1 ${vg}.stl
stl_color ${vg}.stl $color ${vg}_${cn}.stl

echo MAKE  Bierds Eye View Images and Movie

stl_bev_C_SS ${vg}_${cn}.stl $scale 1 16 255 255 255 0 0 0 0 0 0 <<fin
0 0 ${vg}+X.tif
90 0 ${vg}+Y.tif
0 90 ${vg}+Z.tif
0 -90 ${vg}-Z.tif
60 -20 ${vg}_60_-20.tif
-120 20 ${vg}_-120_20.tif
fin

stl_bev_C_GIF_SS  ${vg}_${cn}.stl $scale 1 16 255 255 255 0 0 0 0 0 0 ${vg}.gif <<fin
0 0 0 2 100
0 200 2 0 180
0 200 0 2 80
fin

rm -r cut


echo OPERATIONS FOR VOIDS COMPLETED

