Changeset 6497


Ignore:
Timestamp:
06/07/10 18:59:19 (10 years ago)
Author:
melissa
Message:

Throw an exception if ImageProcessor types don't match.

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/4.2/components/loci-plugins/src/loci/plugins/in/ImagePlusReader.java

    r6477 r6497  
    267267          // merge image plane into existing stack if possible 
    268268          if (stackB != null) { 
    269             ip = ip.convertToByte(true); 
    270             stackB.addSlice(label, ip); 
     269            throw new FormatException( 
     270              "Found a FloatProcessor, expected a ByteProcessor"); 
    271271          } 
    272272          else if (stackS != null) { 
    273             ip = ip.convertToShort(true); 
    274             stackS.addSlice(label, ip); 
     273            throw new FormatException( 
     274              "Found a FloatProcessor, expected a ShortProcessor"); 
    275275          } 
    276276          else { 
  • trunk/components/loci-plugins/src/loci/plugins/in/ImagePlusReader.java

    r6475 r6497  
    257257        int w = region.width, h = region.height; 
    258258        if (ip instanceof ByteProcessor) { 
    259           if (stackB == null) stackB = new ImageStack(w, h); 
    260           stackB.addSlice(label, ip); 
     259          throw new FormatException( 
     260            "Found a FloatProcessor, expected a ByteProcessor"); 
    261261        } 
    262262        else if (ip instanceof ShortProcessor) { 
    263           if (stackS == null) stackS = new ImageStack(w, h); 
    264           stackS.addSlice(label, ip); 
     263          throw new FormatException( 
     264            "Found a FloatProcessor, expected a ShortProcessor"); 
    265265        } 
    266266        else if (ip instanceof FloatProcessor) { 
Note: See TracChangeset for help on using the changeset viewer.