#!/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=b186				#name of void grain
set scale=5				#scale for bird's eye view map


set dir=051120b
set area=(559 855 204 563 861 207)	#(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=(562 838 196 570 849 204)	#(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=(545 829 191 558 844 204)	#(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=(530 813 186 549 838 204)	#(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=(521 810 178 550 845 205)	#(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=(516 787 167 562 840 208)	#(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=(504 754 125 563 840 204)	#(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=(482 730 121 586 844 242)	#(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=(413 645 87 608 1035 375)	#(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=(339 425 47 843 1159 482)	#(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

