Changeset 3501


Ignore:
Timestamp:
12/27/07 17:14:32 (12 years ago)
Author:
melissa
Message:

Added sub-C labels and hooks for merging using spectral projection.

Location:
trunk/loci/plugins
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/loci/plugins/Colorizer.java

    r3493 r3501  
    111111    else { 
    112112      stackOrder = Macro.getValue(arg, "stack_order", "XYCZT"); 
    113       merge = new Boolean(Macro.getValue(arg, "merge", "true")).booleanValue(); 
    114       color = 
    115         new Boolean(Macro.getValue(arg, "colorize", "false")).booleanValue(); 
     113      merge = Boolean.parseBoolean(Macro.getValue(arg, "merge", "true")); 
     114      color = Boolean.parseBoolean(Macro.getValue(arg, "colorize", "false")); 
    116115      colorNdx = Integer.parseInt(Macro.getValue(arg, "ndx", "0")); 
    117116      mergeOption = Macro.getValue(arg, "merge_option", null); 
    118117      hyperstack = 
    119         new Boolean(Macro.getValue(arg, "hyper_stack", "false")).booleanValue(); 
     118        Boolean.parseBoolean(Macro.getValue(arg, "hyper_stack", "false")); 
    120119    } 
    121120 
     
    205204        ImporterOptions options = new ImporterOptions(); 
    206205 
     206        boolean spectral = 
     207          stack.getSliceLabel(1).indexOf(FormatTools.SPECTRA) != -1; 
     208 
    207209        if (mergeOption == null) { 
    208           int status = options.promptMergeOption(num); 
     210          int status = options.promptMergeOption(num, spectral); 
    209211          if (status == ImporterOptions.STATUS_OK) { 
    210212            mergeOption = options.getMergeOption(); 
     213          } 
     214          // TEMP - remove this once spectral projection is implemented 
     215          while (mergeOption.equals(ImporterOptions.MERGE_PROJECTION)) { 
     216            IJ.error("Spectral projection has not been implemented."); 
     217            status = options.promptMergeOption(num, spectral); 
     218            if (status == ImporterOptions.STATUS_OK) { 
     219              mergeOption = options.getMergeOption(); 
     220            } 
    211221          } 
    212222        } 
     
    233243              } 
    234244            } 
     245            else if (mergeOption.equals(ImporterOptions.MERGE_PROJECTION)) { 
     246              // TODO 
     247              // Add spectral projection logic here (see ticket #86). 
     248            } 
     249            else closeOriginal = false; 
    235250          } 
    236251        } 
  • trunk/loci/plugins/Importer.java

    r3500 r3501  
    719719    r.setSeries(series); 
    720720    int[] zct = r.getZCTCoords(ndx); 
     721    int[] subC = r.getChannelDimLengths(); 
     722    String[] subCTypes = r.getChannelDimTypes(); 
    721723    StringBuffer sb = new StringBuffer(); 
    722724    if (r.isOrderCertain()) { 
     
    725727        if (first) first = false; 
    726728        else sb.append("; "); 
    727         sb.append("ch:"); 
    728         sb.append(zct[1] + 1); 
    729         sb.append("/"); 
    730         sb.append(r.getSizeC()); 
     729        int[] subCPos = FormatTools.rasterToPosition(subC, zct[1]); 
     730        for (int i=0; i<subC.length; i++) { 
     731          if (!subCTypes[i].equals(FormatTools.CHANNEL)) sb.append(subCTypes[i]); 
     732          else sb.append("ch"); 
     733          sb.append(":"); 
     734          sb.append(subCPos[i] + 1); 
     735          sb.append("/"); 
     736          sb.append(subC[i]); 
     737          if (i < subC.length - 1) sb.append("; "); 
     738        } 
    731739      } 
    732740      if (counts[0][series] > 1) { 
  • trunk/loci/plugins/ImporterOptions.java

    r3496 r3501  
    7676  public static final String ORDER_XYTZC = "XYTZC"; 
    7777 
     78  // merging options 
    7879  public static final String MERGE_DEFAULT = "Do not merge"; 
     80  public static final String MERGE_PROJECTION = "Spectral projection"; 
    7981 
    8082  // class to check for each viewing option 
     
    469471  } 
    470472 
    471   public int promptMergeOption(int[] nums) { 
     473  public int promptMergeOption(int[] nums, boolean spectral) { 
    472474    if (windowless) return STATUS_OK; 
    473475    GenericDialog gd = new GenericDialog("Merging Options..."); 
    474476 
    475     String[] options = new String[7]; 
     477    String[] options = new String[spectral ? 8 : 7]; 
    476478    options[6] = MERGE_DEFAULT; 
     479    if (spectral) options[7] = MERGE_PROJECTION; 
    477480    for (int i=0; i<6; i++) { 
    478481      options[i] = nums[i] + " planes, " + (i + 2) + " channels per plane"; 
     
    485488 
    486489    mergeOption = options[gd.getNextChoiceIndex()]; 
     490 
    487491    return STATUS_OK; 
    488492  } 
Note: See TracChangeset for help on using the changeset viewer.