Print

Print


Commit in CDMS/src/CDMS/ImageNavigatorII on MAIN
Stitcher.java+13-121.3 -> 1.4
first run on the server

CDMS/src/CDMS/ImageNavigatorII
Stitcher.java 1.3 -> 1.4
diff -u -r1.3 -r1.4
--- Stitcher.java	28 Jul 2010 23:24:21 -0000	1.3
+++ Stitcher.java	29 Jul 2010 18:26:00 -0000	1.4
@@ -8,7 +8,7 @@
 import java.util.*;
 
 /*
- * Looking in the $path given, this program takes the autorun.txt file and the images of 
+ * Looking in the $imagePath given, this program takes the autorun.txt file and the images of 
  * the form $imageFileName (replace the counting element with "#"), and stitches them 
  * together into larger images.  Because an image containing all the stitched images 
  * would be far too large for most computers to handle, these are saved in images of 
@@ -19,7 +19,6 @@
  * File Structure:
  * 	>Image Set Folder
  * 		>gmapviewer.htm	[the website navigator file!]
- * 		>original_images	[place the autorun.txt file and images in this folder before running this program]
  * 		>resources	[do not touch these files, they are used by the Google API for the navigator]
  * 		>stitched_images	[stitched images will be saved here]
  * 		>tiles	[when you run Tiler.java, the tiles for the navigator will be placed here.]
@@ -31,10 +30,15 @@
     public static void main(String[] args) throws IOException {
     	Date startDate = new Date();
 		//read in the file and create a list of command lines (split by SET_PART_REPEAT)(dont use arg 0)
-	    String path = "/Users/chriswilen/Documents/Work/Summer_2010/IZipG18M_TB_75x3/tiles/gmapviewer/";
-	    String autorunFile = "Autorun_IZipG18M_TB_75x3_11May10.txt";
-    	String imageFileName = "/"+"IZipG18M_TB_75x3-#.png";
-		String[] lines = getLines(path+"/original_images/"+autorunFile);
+	    String imagePath = "/nfs/farm/g/ee/u15/cdms/CDMS_ImageNavigator/IZipG47_Side1_Al/";
+    	String savePath = "/nfs/farm/g/ee/u15/cdms/CDMS_ImageNavigatorII/wilenc/IZipG47_Side1_Al/";
+	    String autorunFile = "Autorun_IZipG47_Side1_Al_23July10.txt";
+    	String imageFileName = "/"+"IZipG47_Side1_Al-#.png";
+        double theta = Math.atan(2/640);
+	    double pxSize = 1.397/1000;	//x75.3 magnification: 5.452um | x293 magnification: 1.397um
+    	
+    	
+		String[] lines = getLines(imagePath+"/"+autorunFile);
 	    
 	    //split the arguments of each line into a list of arguments: number of repeats in row, corrected start X value
 	    //also, declares some relevant variables: minimum start x, pixel size, maximum number of repeats
@@ -44,7 +48,6 @@
 	    ArrayList<Double> moveX = new ArrayList<Double>();
 	    double xMin = 1000;
 	    int maxCols = 0;
-	    double pxSize = 5.452/1000;//3.37085208/620;//x75.3 magnification: 5.452um
 	    for (int i=1; i<lines.length; i++){
 	    	int repeat = Integer.parseInt(lines[i].split(",")[1]);
 	    	cols.add(repeat);
@@ -59,8 +62,7 @@
 	    
 	    //declare variables 
 	    /*********************/
-        double theta = Math.atan(3/640);
-    	BufferedImage image = ImageIO.read(new File(  path+"/original_images/"+imageFileName.replace("#","1")  ));
+    	BufferedImage image = ImageIO.read(new File(  imagePath+"/"+imageFileName.replace("#","1")  ));
         int imgW = image.getWidth();
         int imgH = image.getHeight();
         int tileW = 2048;
@@ -101,8 +103,7 @@
         	    		lastImage++;
         	    		//if it is in the tile, make a square with the image tilted appropriately
         	        	if (drawX>minTileRenderX && drawX<maxTileRenderX && drawY>minTileRenderY && drawY<maxTileRenderY) {
-        	        		String imagePath = path+"/original_images/"+imageFileName.replace("#",""+lastImage);
-    	        			image = ImageIO.read(new File(imagePath));
+    	        			image = ImageIO.read(new File(imagePath+"/"+imageFileName.replace("#",""+lastImage)));
             	    		at = AffineTransform.getTranslateInstance(0, 0);
             	            g2.drawRenderedImage(image, at);
             	            
@@ -136,7 +137,7 @@
         	        	}
         	        }
         	    }
-        		if (draw==true) ImageIO.write(toStore, "PNG", new File(path+"/stitched_images/"+row+"_"+col+".png"));
+        		if (draw==true) ImageIO.write(toStore, "PNG", new File(savePath+"/stitched_images/"+row+"_"+col+".png"));
         		g2.dispose();
         	}
         }
CVSspam 0.2.8