Changeset 4852


Ignore:
Timestamp:
02/26/09 19:55:06 (11 years ago)
Author:
melissa
Message:

Fixed various ImageJ plugin problems (mostly macro related). The custom colorize option is still not recorded properly.

Location:
trunk/components/loci-plugins/src/loci/plugins
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/components/loci-plugins/src/loci/plugins/Colorizer.java

    r4796 r4852  
    212212          promptForColor(0); 
    213213        } 
     214        if (lut == null) return; 
    214215 
    215216        IndexColorModel model = new IndexColorModel(8, 256, lut[0][0], 
     
    391392 
    392393  private void promptForColor(int channel) { 
    393     ColorChooser chooser = new ColorChooser("Color Chooser - Channel " + 
    394       channel, Color.BLACK, false); 
     394    ColorChooser chooser = new ColorChooser( 
     395      "Color Chooser - Channel " + channel, Color.BLACK, false); 
    395396 
    396397    Color color = chooser.getColor(); 
     398    if (color == null) return; 
    397399    double redIncrement = ((double) color.getRed()) / 255; 
    398400    double greenIncrement = ((double) color.getGreen()) / 255; 
  • trunk/components/loci-plugins/src/loci/plugins/Importer.java

    r4812 r4852  
    287287        } 
    288288        seriesLabels[i] = sb.toString(); 
    289       } 
    290  
    291       if (seriesCount > 1 && !options.openAllSeries()) { 
     289        seriesLabels[i] = seriesLabels[i].replaceAll(" ", "_"); 
     290      } 
     291 
     292      if (seriesCount > 1 && !options.openAllSeries() && !options.isViewNone()) 
     293      { 
    292294        status = options.promptSeries(r, seriesLabels, series); 
    293295        if (!statusOk(status)) return; 
    294296      } 
    295297 
    296       if (options.openAllSeries()) Arrays.fill(series, true); 
     298      if (options.openAllSeries() || options.isViewNone()) { 
     299        Arrays.fill(series, true); 
     300      } 
    297301 
    298302      // -- Step 4c: prompt for dimension swapping parameters, if necessary -- 
     
    846850          if (colorize || customColorize) { 
    847851            int[] openImages = WindowManager.getIDList(); 
    848             int nOpenImages = WindowManager.getImageCount(); 
    849             for (int i=0; i<nOpenImages; i++) { 
    850               ImagePlus p = 
    851                 WindowManager.getImage(WindowManager.getNthImageID(1)); 
     852            for (int i=0; i<openImages.length; i++) { 
     853              ImagePlus p = WindowManager.getImage(openImages[i]); 
     854              if (p == null) continue; 
    852855              String title = p.getTitle(); 
    853               if (title.startsWith(imp.getTitle()) && 
    854                 title.indexOf("C=") != -1) 
    855               { 
     856              if (!title.startsWith(imp.getTitle())) continue; 
     857 
     858              WindowManager.setTempCurrentImage(p); 
     859 
     860              if (p.getTitle().indexOf("C=") != -1) { 
    856861                int channel = 
    857862                  Integer.parseInt(title.substring(title.indexOf("C=") + 2)); 
    858                 WindowManager.setCurrentWindow(p.getWindow()); 
    859863                int channelIndex = customColorize ? -1 : channel % 3; 
    860864                IJ.runPlugIn("loci.plugins.Colorizer", 
    861865                  "stack_order=" + stackOrder + " merge=false colorize=true" + 
    862866                  " ndx=" + channelIndex + " hyper_stack=" + 
     867                  options.isViewHyperstack() + " "); 
     868              } 
     869              else { 
     870                IJ.runPlugIn("loci.plugins.Colorizer", "stack_order=" + 
     871                  stackOrder + " merge=false colorize=true ndx=" + 
     872                  (customColorize ? "-1" : "0") + " hyper_stack=" + 
    863873                  options.isViewHyperstack() + " "); 
    864874              } 
  • trunk/components/loci-plugins/src/loci/plugins/ImporterOptions.java

    r4730 r4852  
    131131  public static final String LABEL_ORDER = "Stack_order: "; 
    132132  public static final String LABEL_MERGE = "Merge_channels to RGB"; 
    133   public static final String LABEL_COLORIZE = "Colorize channels (RGB)"; 
     133  public static final String LABEL_COLORIZE = "RGB_colorize channels"; 
    134134  public static final String LABEL_COLORIZE_CUSTOM = 
    135     "Colorize channels (custom colors)"; 
     135    "Custom_colorize channels"; 
    136136  public static final String LABEL_SPLIT_C = "Split_channels"; 
    137137  public static final String LABEL_SPLIT_Z = "Split_focal planes"; 
     
    13751375      gd.addMessage("Series " + n + ":\n"); 
    13761376 
    1377       int[] axisSizes = new int[] {r.getSizeZ(), r.getSizeC(), r.getSizeT()}; 
    1378  
    13791377      for (int i=0; i<labels.length; i++) { 
    1380         gd.addChoice(axisSizes[i] + "_planes", labels, labels[i]); 
     1378        gd.addChoice(i + "_planes", labels, labels[i]); 
    13811379      } 
    13821380    } 
Note: See TracChangeset for help on using the changeset viewer.