/** * Notifies this panel that values in the referenced 3D array have changed. */ public void update() { _texturesDirty = true; dirtyDraw(); }
protected void draw(DrawContext dc) { updateClipMinMax(); drawTextures(); }
/** * Gets an image panel in this group with the specified axis. * @param axis the axis. * @return the image panel; null, if none has the axis specified. */ public ImagePanel getImagePanel(Axis axis) { for (ImagePanel ip:_ipList) { if (axis==ip.getFrame().getAxis()) return ip; } return null; }
AxisAlignedQuad aaq = new AxisAlignedQuad(axes[jp],qmin,qmax); AxisAlignedFrame aaf = aaq.getFrame(); ImagePanel ip1 = new ImagePanel(s1,s2,s3,f1); ImagePanel ip2 = new ImagePanel(s1,s2,s3,f2); ip1.setStates(ss1); ip2.setStates(ss2); ip1.setColorModel(getColorModel1()); ip2.setColorModel(getColorModel2()); aaf.addChild(ip1); aaf.addChild(ip2);
private void drawTextures() { AxisAlignedFrame frame = getFrame(); if (frame==null) return; updateSampling(axis,_sx,_sy,_sz); if (_xmin!=xmin || _ymin!=ymin || _zmin!=zmin || _xmax!=xmax || _ymax!=ymax || _zmax!=zmax) updateBoundsAndTextures(xmin,ymin,zmin,xmax,ymax,zmax); updateTextures();
for (int jp=0; jp<np; ++jp) { AxisAlignedQuad aaq = new AxisAlignedQuad(axes[jp],qmin,qmax); ImagePanel ip = new ImagePanel(s1,s2,s3,f3); ip.setColorModel(getColorModel()); aaq.getFrame().addChild(ip); this.addChild(aaq);
/** * Sets the percentiles used to compute clips for 1st image panels in * this group. The default percentiles are 0 and 100, which correspond * to the minimum and maximum array values. * <p> * Calling this method enables the computation of clips from percentiles. * Any clip values specified or computed previously will be forgotten. * @param percMin the percentile corresponding to clipMin. * @param percMax the percentile corresponding to clipMax. */ public void setPercentiles1(double percMin, double percMax) { _clips1.setPercentiles(percMin,percMax); double clipMin = _clips1.getClipMin(); double clipMax = _clips1.getClipMax(); //System.out.println("clip min="+clipMin+" max="+clipMax); for (ImagePanel ip:_ip1List) ip.setClips(clipMin,clipMax); _colorMap1.setValueRange(clipMin,clipMax); }
tn = staleList.remove(--nstale); } else { tn = makeTexture(); loadTexture(js,jt);
ImagePanel iop = new ImagePanel(sz,sy,sx,f3); aaf.addChild(iop);
/** * Sets the index color model for 1st image panels in this group. * The default color model is a black-to-white gray model. * @param colorModel the index color model. */ public void setColorModel1(IndexColorModel colorModel) { _colorMap1.setColorModel(colorModel); for (ImagePanel ip:_ip1List) ip.setColorModel(colorModel); }
private void updateTextures() { // Reload only those textures already cached. for (int jt=_jtmin; jt<=_jtmax; ++jt) { for (int js=_jsmin; js<=_jsmax; ++js) { if (_tn[jt][js]!=null) loadTexture(js,jt); } } // Textures now clean. _texturesDirty = false; }
private void updateSampling( Axis axis, Sampling sx, Sampling sy, Sampling sz) disposeTextures(); int nx = sx.getCount(); int ny = sy.getCount();
/** * Sets the percentiles used to compute clips for this group. The default * percentiles are 0 and 100, which correspond to the minimum and maximum * array values. * <p> * Calling this method enables the computation of clips from percentiles. * Any clip values specified or computed previously will be forgotten. * @param percMin the percentile corresponding to clipMin. * @param percMax the percentile corresponding to clipMax. */ public void setPercentiles(double percMin, double percMax) { _clips.setPercentiles(percMin,percMax); double clipMin = _clips.getClipMin(); double clipMax = _clips.getClipMax(); //System.out.println("clip min="+clipMin+" max="+clipMax); for (ImagePanel ip:_ipList) ip.setClips(clipMin,clipMax); _colorMap.setValueRange(clipMin,clipMax); }
/** * Sets the index color model for this group. * The default color model is a black-to-white gray model. * @param colorModel the index color model. */ public void setColorModel(IndexColorModel colorModel) { _colorMap.setColorModel(colorModel); for (ImagePanel ip:_ipList) ip.setColorModel(colorModel); }
/** * Gets a 1st image panel in this group with the specified axis. * @param axis the axis. * @return the image panel; null, if none has the axis specified. */ public ImagePanel getImagePanel1(Axis axis) { for (ImagePanel ip:_ip1List) { if (axis==ip.getFrame().getAxis()) return ip; } return null; }
/** * Sets the clips for 2nd image panels in this group. Image panels in * this group map array values to bytes, which are then used as indices * into a specified color model. This mapping from array values to byte * indices is linear, and so depends on only these two clip values. The * clip minimum value corresponds to byte index 0, and the clip maximum * value corresponds to byte index 255. Sample values outside of the * range [clipMin,clipMax] are clipped to lie inside this range. * <p> * Calling this method disables the computation of clips from percentiles. * Any clip values computed or specified previously will be forgotten. * @param clipMin the sample value corresponding to color model index 0. * @param clipMax the sample value corresponding to color model index 255. */ public void setClips2(double clipMin, double clipMax) { _clips2.setClips(clipMin,clipMax); clipMin = _clips2.getClipMin(); clipMax = _clips2.getClipMax(); for (ImagePanel ip:_ip2List) ip.setClips(clipMin,clipMax); _colorMap2.setValueRange(clipMin,clipMax); }
/** * Sets the index color model for this panel. * The default color model is a black-to-white gray model. * @param colorModel the index color model. */ public void setColorModel(IndexColorModel colorModel) { _colorMap.setColorModel(colorModel); _texturesDirty = true; dirtyDraw(); }
/** * Sets the index color model for 2nd image panels in this group. * The default color model is a jet model with alpha = 0.5. * @param colorModel the index color model. */ public void setColorModel2(IndexColorModel colorModel) { _colorMap2.setColorModel(colorModel); for (ImagePanel ip:_ip2List) ip.setColorModel(colorModel); }
/** * Gets a 2nd image panel in this group with the specified axis. * @param axis the axis. * @return the image panel; null, if none has the axis specified. */ public ImagePanel getImagePanel2(Axis axis) { for (ImagePanel ip:_ip2List) { if (axis==ip.getFrame().getAxis()) return ip; } return null; }
/** * Sets the clips for this group. Image panels in this group map array * values to bytes, which are then used as indices into a specified color * model. This mapping from array values to byte indices is linear, and * so depends on only these two clip values. The clip minimum value * corresponds to byte index 0, and the clip maximum value corresponds to * byte index 255. Sample values outside of the range [clipMin,clipMax] * are clipped to lie inside this range. * <p> * Calling this method disables the computation of clips from percentiles. * Any clip values computed or specified previously will be forgotten. * @param clipMin the sample value corresponding to color model index 0. * @param clipMax the sample value corresponding to color model index 255. */ public void setClips(double clipMin, double clipMax) { _clips.setClips(clipMin,clipMax); clipMin = _clips.getClipMin(); clipMax = _clips.getClipMax(); for (ImagePanel ip:_ipList) ip.setClips(clipMin,clipMax); _colorMap.setValueRange(clipMin,clipMax); }