public void setModalityLUT(Attributes attrs) { rescaleIntercept = attrs.getFloat(Tag.RescaleIntercept, 0); rescaleSlope = attrs.getFloat(Tag.RescaleSlope, 1); modalityLUT = createLUT(storedValue, attrs.getNestedDataset(Tag.ModalityLUTSequence)); }
private LookupTable createLUT(StoredValue inBits, Attributes attrs) { if (attrs == null) return null; return createLUT(inBits, attrs.getInts(Tag.LUTDescriptor), attrs.getSafeBytes(Tag.LUTData), attrs.bigEndian()); }
public void setModalityLUT(Attributes attrs) { rescaleIntercept = attrs.getFloat(Tag.RescaleIntercept, 0); rescaleSlope = attrs.getFloat(Tag.RescaleSlope, 1); modalityLUT = createLUT(storedValue, attrs.getNestedDataset(Tag.ModalityLUTSequence)); }
private LookupTable createLUT(StoredValue inBits, Attributes attrs) { if (attrs == null) return null; return createLUT(inBits, attrs.getInts(Tag.LUTDescriptor), attrs.getSafeBytes(Tag.LUTData), attrs.bigEndian()); }
public void setVOI(Attributes img, int windowIndex, int voiLUTIndex, boolean preferWindow) { if (img == null) return; Attributes vLUT = img.getNestedDataset(Tag.VOILUTSequence, voiLUTIndex); if (preferWindow || vLUT == null) { float[] wcs = img.getFloats(Tag.WindowCenter); float[] wws = img.getFloats(Tag.WindowWidth); if (wcs != null && wcs.length != 0 && wws != null && wws.length != 0) { int index = windowIndex < Math.min(wcs.length, wws.length) ? windowIndex : 0; windowCenter = wcs[index]; windowWidth = wws[index]; return; } } if (vLUT != null) voiLUT = createLUT(modalityLUT != null ? new StoredValue.Unsigned(modalityLUT.outBits) : storedValue, vLUT); }
public void setVOI(Attributes img, int windowIndex, int voiLUTIndex, boolean preferWindow) { if (img == null) return; Attributes vLUT = img.getNestedDataset(Tag.VOILUTSequence, voiLUTIndex); if (preferWindow || vLUT == null) { float[] wcs = img.getFloats(Tag.WindowCenter); float[] wws = img.getFloats(Tag.WindowWidth); if (wcs != null && wcs.length != 0 && wws != null && wws.length != 0) { int index = windowIndex < Math.min(wcs.length, wws.length) ? windowIndex : 0; windowCenter = wcs[index]; windowWidth = wws[index]; return; } } if (vLUT != null) voiLUT = createLUT(modalityLUT != null ? new StoredValue.Unsigned(modalityLUT.outBits) : storedValue, vLUT); }
public void setPresentationLUT(Attributes attrs) { Attributes pLUT = attrs.getNestedDataset(Tag.PresentationLUTSequence); if (pLUT != null) { int[] desc = pLUT.getInts(Tag.LUTDescriptor); if (desc != null && desc.length == 3) { int len = desc[0] == 0 ? 0x10000 : desc[0]; presentationLUT = createLUT(new StoredValue.Unsigned(log2(len)), resetOffset(desc), pLUT.getSafeBytes(Tag.LUTData), pLUT.bigEndian()); } } else { String pShape = attrs.getString(Tag.PresentationLUTShape); inverse = (pShape != null ? "INVERSE".equals(pShape) : "MONOCHROME1".equals( attrs.getString(Tag.PhotometricInterpretation))); } }
public void setPresentationLUT(Attributes attrs) { Attributes pLUT = attrs.getNestedDataset(Tag.PresentationLUTSequence); if (pLUT != null) { int[] desc = pLUT.getInts(Tag.LUTDescriptor); if (desc != null && desc.length == 3) { int len = desc[0] == 0 ? 0x10000 : desc[0]; presentationLUT = createLUT(new StoredValue.Unsigned(log2(len)), resetOffset(desc), pLUT.getSafeBytes(Tag.LUTData), pLUT.bigEndian()); } } else { String pShape = attrs.getString(Tag.PresentationLUTShape); inverse = (pShape != null ? "INVERSE".equals(pShape) : "MONOCHROME1".equals( attrs.getString(Tag.PhotometricInterpretation))); } }
lutParam.setPresentationLUT(imgAttrs); LookupTable lut = lutParam.createLUT(outBits); lut.lookup(raster, destRaster); return destRaster;