[Zooimage-commits] r76 - in pkg/zooimage: R inst/imagej/plugins src/src/org/sciviews/zooimage

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Wed Apr 15 15:16:51 CEST 2009


Author: romain
Date: 2009-04-15 15:16:50 +0200 (Wed, 15 Apr 2009)
New Revision: 76

Modified:
   pkg/zooimage/R/log.r
   pkg/zooimage/R/zid.r
   pkg/zooimage/inst/imagej/plugins/_zooimage.jar
   pkg/zooimage/src/src/org/sciviews/zooimage/ZooImage.java
   pkg/zooimage/src/src/org/sciviews/zooimage/ZooImagePlugin.java
Log:
hiding new ZooImageGui class (for now)

Modified: pkg/zooimage/R/log.r
===================================================================
--- pkg/zooimage/R/log.r	2009-04-15 12:57:25 UTC (rev 75)
+++ pkg/zooimage/R/log.r	2009-04-15 13:16:50 UTC (rev 76)
@@ -45,7 +45,7 @@
 
 # TODO: improve these
 logError <- function( e, msg= NULL, ... ){
-	logProcess( if( is.null(msg)) e$msg else msg, e$context, stop = TRUE, ... )
+	logProcess( if( is.null(msg)) e$msg else msg, e$context, stop = FALSE, ... )
 }
 logWarning <- function( w, msg= NULL,... ){
 	logProcess( if( is.null(msg)) e$msg else msg, w$context, stop = FALSE, ... )

Modified: pkg/zooimage/R/zid.r
===================================================================
--- pkg/zooimage/R/zid.r	2009-04-15 12:57:25 UTC (rev 75)
+++ pkg/zooimage/R/zid.r	2009-04-15 13:16:50 UTC (rev 76)
@@ -25,46 +25,37 @@
 #' @param show.log do we show a log at the end
 verify.zid <- function(zidir, type = "ZI1", check.vignettes = TRUE, show.log = TRUE) {
 	
-	# {{{ check the format of the file
+	# heck the format of the file
 	# This should be a directory containing XXX+YY_dat1.zim files + .jpg files
 	if (type != "ZI1") {
 		stop("only 'ZI1' is currently supported for 'type'!")
 	}
-	# }}}
 	
-	# {{{ check the list of _dat1.zim
+	# check the list of _dat1.zim
 	dat1files <- list.dat1.zim(zidir)
 	if(length(dat1files) == 0) {
 		stop( "no '_dat1.zim' file!" )
 	}
-	if (length(dat1files) == 1 && is.na(dat1files)) {
-	 	stop( "not found or not a directory!" )
-	}
-	# }}}
 	
-    # {{{ Check the content of all these "_dat1.zim" files 
+    # Check the content of all these "_dat1.zim" files 
 	#     and retrieve the number of items measured
 	dat1files <- sort(dat1files)
 	# Default to -1 for corrupted dat1 files
-	nitems <- rep( -1, length(dat1files) )	 
-	for (i in 1:length(dat1files)) {
-		
-		# this might generate, which we need to handle somehow
-		res <- verify.zim(file.path(zidir, dat1files[i]), is.dat1 = TRUE)
-		if( length( res ) ){
-			nitems[i] <- res
-		}
-		
-	}
-	ok <- any( nitems == -1 )
-	# }}}
+	nitems <- sapply( dat1files, function( x ){
+		tryCatch( 
+			verify.zim( file.path( zidir, x), is.dat1 = TRUE ), 
+			zooImageError = function(e ){
+				logError( e )
+				-1
+			} )
+	} )
+	ok <- ! any( nitems == -1)
 	
 	# {{{ check the vignettes
 	if (check.vignettes) {
 		
-        # {{{ Check that we have corresponding vignettes (XXX+YY_ZZZ.jpg files)
+        # Check that we have corresponding vignettes (XXX+YY_ZZZ.jpg files)
     	samples <- sub("_dat1[.]zim$", "", dat1files)
-		# }}}
 		
     	# {{{ Check the content of the directory for .jpg files
     	for (i in 1:length(samples)) {

Modified: pkg/zooimage/inst/imagej/plugins/_zooimage.jar
===================================================================
(Binary files differ)

Modified: pkg/zooimage/src/src/org/sciviews/zooimage/ZooImage.java
===================================================================
--- pkg/zooimage/src/src/org/sciviews/zooimage/ZooImage.java	2009-04-15 12:57:25 UTC (rev 75)
+++ pkg/zooimage/src/src/org/sciviews/zooimage/ZooImage.java	2009-04-15 13:16:50 UTC (rev 76)
@@ -56,10 +56,10 @@
 	 */
 	public static void main(String args[]) {
 		
-		ZooImageGui _gui = new ZooImageGui() ;
-		_gui.setPreferredSize(new Dimension( 800, 600) ) ;
-		_gui.pack();
-		_gui.setVisible(true);
+		// ZooImageGui _gui = new ZooImageGui() ;
+		// _gui.setPreferredSize(new Dimension( 800, 600) ) ;
+		// _gui.pack();
+		// _gui.setVisible(true);
 		
 		
 		if(args.length != 3 && args.length != 2 ) {

Modified: pkg/zooimage/src/src/org/sciviews/zooimage/ZooImagePlugin.java
===================================================================
--- pkg/zooimage/src/src/org/sciviews/zooimage/ZooImagePlugin.java	2009-04-15 12:57:25 UTC (rev 75)
+++ pkg/zooimage/src/src/org/sciviews/zooimage/ZooImagePlugin.java	2009-04-15 13:16:50 UTC (rev 76)
@@ -1,6 +1,5 @@
 package org.sciviews.zooimage;
 
-import java.awt.Dimension;
 import java.io.File;
 import java.util.TreeSet;
 import java.util.Vector;
@@ -10,7 +9,6 @@
 import org.sciviews.zooimage.config.ScaleConfig;
 import org.sciviews.zooimage.exceptions.ZooImageException;
 import org.sciviews.zooimage.files.ZimFile;
-import org.sciviews.zooimage.gui.ZooImageGui;
 import org.sciviews.zooimage.log.Log;
 import org.sciviews.zooimage.tools.FileExtensions;
 import org.sciviews.zooimage.tools.IJUtilities;



More information about the Zooimage-commits mailing list