Changeset 3091 for trunk


Ignore:
Timestamp:
08/20/07 08:53:19 (13 years ago)
Author:
melissa
Message:

Fixed how custom LUTs are handled in Leica LEI files.

Location:
trunk/loci/formats
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/loci/formats/TiffTools.java

    r3046 r3091  
    17151715            int cndx = i == 0 ? x : (i == 1 ? (x + bpsPow) : (x + 2*bpsPow)); 
    17161716            int cm = colorMap[cndx]; 
    1717             samples[i][ndx] = (short) (maxValue == 0 ? (cm % 255) : cm); 
     1717            samples[i][ndx] = (short) (maxValue == 0 ? (cm / 256) : cm); 
    17181718          } 
    17191719          else if (photoInterp == CMYK) { 
  • trunk/loci/formats/in/LeicaReader.java

    r3088 r3091  
    136136      FormatTools.getBytesPerPixel(core.pixelType[series])); 
    137137 
    138     b = ImageTools.splitChannels(b, c, 
    139       FormatTools.getBytesPerPixel(core.pixelType[series]), false, 
    140       isInterleaved())[channelIndices[ndx]]; 
     138    // if a custom LUT is used, we don't want to split channels 
     139    if (channelIndices[ndx] > -1) { 
     140      b = ImageTools.splitChannels(b, c, 
     141        FormatTools.getBytesPerPixel(core.pixelType[series]), false, 
     142        isInterleaved())[channelIndices[ndx]]; 
     143    } 
    141144    tiff[series][no].close(); 
    142145    return b; 
     
    158161    int c = buf.length / (core.sizeX[series] * core.sizeY[series] * 
    159162      FormatTools.getBytesPerPixel(core.pixelType[series])); 
    160     buf = ImageTools.splitChannels(buf, c, 
    161       FormatTools.getBytesPerPixel(core.pixelType[series]), false, 
    162       isInterleaved())[channelIndices[ndx]]; 
     163     
     164    // if a custom LUT is used, we don't want to split channels 
     165    if (channelIndices[ndx] > -1) { 
     166      buf = ImageTools.splitChannels(buf, c, 
     167        FormatTools.getBytesPerPixel(core.pixelType[series]), false, 
     168        isInterleaved())[channelIndices[ndx]]; 
     169    } 
    163170    return buf; 
    164171  } 
     
    176183    int ndx = no % channelIndices.length; 
    177184 
    178     b = ImageTools.splitChannels(b)[channelIndices[ndx]]; 
     185    // if a custom LUT is used, we don't want to split channels 
     186    if (channelIndices[ndx] > -1) { 
     187      b = ImageTools.splitChannels(b)[channelIndices[ndx]]; 
     188    }  
    179189    tiff[series][no].close(); 
    180190    return b; 
     
    988998          else if (name.equals("Gray")) channelIndices[j] = 0; 
    989999          else if (name.equals("Yellow")) channelIndices[j] = 0; 
    990           else if (name.equals("Geo (L&S)")) channelIndices[j] = 0; 
     1000          else { 
     1001            // using a custom LUT 
     1002            channelIndices[j] = -1;  
     1003          } 
    9911004 
    9921005          addMeta("LUT Channel " + j + " name", name); 
     
    10721085      Integer ii = new Integer(i); 
    10731086 
     1087      // if a custom LUT is used, we don't want to split channels 
     1088      if (channelIndices[0] == -1) { 
     1089        core.sizeC[i] *= 3; 
     1090        core.rgb[i] = true;  
     1091      }   
     1092 
    10741093      store.setPixels( 
    10751094        new Integer(core.sizeX[i]), 
Note: See TracChangeset for help on using the changeset viewer.