• Views
  • Iteration Report
  • My Iteration Report
  •  
OMERO.clients
  • Login
  • Help/Guide
  • About Trac
  • Preferences
  • Wiki
  • Timeline
  • Roadmap
  • Browse Source
  • View Tickets
  • Search

Context Navigation

  • ← Previous Changeset
  • Next Changeset →

Changeset 5674

Show
Ignore:
Timestamp:
10/10/08 12:03:26 (6 weeks ago)
Author:
jburel
Message:

Attempt to fix OOM exception related to Measurement tool

Location:
trunk/SRC/org/openmicroscopy/shoola
Files:
28 modified

  • agents/measurement/util/model/AnalysisStatsWrapper.java (modified) (2 diffs)
  • agents/measurement/view/GraphPane.java (modified) (4 diffs)
  • agents/measurement/view/IntensityView.java (modified) (11 diffs)
  • agents/measurement/view/MeasurementViewer.java (modified) (4 diffs)
  • agents/measurement/view/MeasurementViewerComponent.java (modified) (5 diffs)
  • agents/measurement/view/MeasurementViewerControl.java (modified) (13 diffs)
  • agents/measurement/view/MeasurementViewerModel.java (modified) (2 diffs)
  • agents/measurement/view/MeasurementViewerUI.java (modified) (9 diffs)
  • agents/measurement/view/ObjectManager.java (modified) (5 diffs)
  • agents/measurement/view/ROITable.java (modified) (6 diffs)
  • env/data/DataServicesFactory.java (modified) (1 diff)
  • env/data/views/calls/Analyser.java (modified) (1 diff)
  • env/rnd/PixelsServicesFactory.java (modified) (2 diffs)
  • env/rnd/roi/PointIterator.java (modified) (6 diffs)
  • env/rnd/roi/PointIteratorObserver.java (modified) (2 diffs)
  • env/rnd/roi/ROIAnalyser.java (modified) (3 diffs)
  • env/rnd/roi/ROIShapeStats.java (modified) (7 diffs)
  • env/rnd/roi/ROIStats.java (modified) (8 diffs)
  • util/roi/figures/MeasureBezierFigure.java (modified) (15 diffs)
  • util/roi/figures/MeasureEllipseFigure.java (modified) (6 diffs)
  • util/roi/figures/MeasureLineConnectionFigure.java (modified) (7 diffs)
  • util/roi/figures/MeasureLineFigure.java (modified) (10 diffs)
  • util/roi/figures/MeasurePointFigure.java (modified) (4 diffs)
  • util/roi/figures/MeasureRectangleFigure.java (modified) (5 diffs)
  • util/roi/figures/MeasureTextFigure.java (modified) (4 diffs)
  • util/roi/figures/ROIFigure.java (modified) (3 diffs)
  • util/ui/component/AbstractComponent.java (modified) (7 diffs)
  • util/ui/drawingtools/figures/RectangleTextFigure.java (modified) (2 diffs)

Legend:

Unmodified
Added
Removed
  • trunk/SRC/org/openmicroscopy/shoola/agents/measurement/util/model/AnalysisStatsWrapper.java

    r5063 r5674  
    2424 
    2525//Java imports 
     26import java.awt.Point; 
    2627import java.util.HashMap; 
    2728import java.util.Iterator; 
    … …  
    7475                Map<Integer, Double>   channelStdDev = new TreeMap<Integer, Double>(); 
    7576                Map<Integer, double[]>  channelData = new TreeMap<Integer, double[]>(); 
    76                 Map<Integer, Map<PlanePoint2D, Double>> channelPixel = new TreeMap<Integer, Map<PlanePoint2D, Double>>(); 
     77                Map<Integer, Map<Point, Double>>        channelPixel =  
     78                        new TreeMap<Integer, Map<Point, Double>>(); 
    7779                Iterator<Double>        pixelIterator; 
    78                 Map<PlanePoint2D,Double> pixels; 
     80                Map<Point, Double> pixels; 
    7981                 
    8082                double[] pixelData; 
  • trunk/SRC/org/openmicroscopy/shoola/agents/measurement/view/GraphPane.java

    r5181 r5674  
    8282         
    8383        /** Index to identify tab */ 
    84         public final static int                                 INDEX = MeasurementViewerUI.GRAPH_INDEX; 
     84        public final static int                                 INDEX =  
     85                                                                                MeasurementViewerUI.GRAPH_INDEX; 
    8586         
    8687        /** The name of the panel. */ 
    … …  
    106107         
    107108        /** Map of the pixel intensity values to coord. */ 
    108         HashMap<Coord3D, Map<Integer, double[]>> pixelStats; 
     109        private Map<Coord3D, Map<Integer, double[]>> pixelStats; 
    109110         
    110111        /** Map of the coord to a shape. */ 
    111         HashMap<Coord3D, ROIShape>                              shapeMap; 
     112        private Map<Coord3D, ROIShape>                          shapeMap; 
    112113         
    113114        /** List of channel Names. */ 
    114         List<String>                                                    channelName ; 
     115        private List<String>    channelName ; 
    115116         
    116117        /** List of channel colours. */ 
    117         List<Color>                                                     channelColour; 
     118        private List<Color>             channelColour; 
    118119         
    119120        /** The current coord of the ROI being depicted in the slider. */ 
    120         Coord3D                                                                 coord; 
     121        private Coord3D                 coord; 
    121122                 
    122123        /** The line profile charts. */ 
    123         LinePlot                                                                lineProfileChart; 
     124        private LinePlot                lineProfileChart; 
    124125         
    125126        /** The histogram chart. */ 
    126         HistogramPlot                                                   histogramChart; 
     127        private HistogramPlot   histogramChart; 
    127128         
    128129        /** The state of the Graph pane. */ 
    129         int                                                                     state= READY; 
     130        private int                             state= READY; 
    130131         
    131132        /** Reference to the view.*/ 
    132         MeasurementViewerUI                                     view; 
     133        private MeasurementViewerUI                                     view; 
    133134         
    134135        /** Current shape. */ 
    135         ROIShape                                                                shape; 
    136          
    137         /** 
    138          * overridded version of {@line TabPaneInterface#getIndex()} 
     136        private ROIShape                                                                shape; 
     137         
     138        /** 
     139         * Overridden version of {@line TabPaneInterface#getIndex()} 
    139140         * @return the index of the tab. 
    140141         */ 
    141         public int getIndex() {return INDEX; } 
     142        public int getIndex() { return INDEX; } 
    142143                 
    143144        /** 
    … …  
    203204                zSlider = new OneKnobSlider(); 
    204205                zSlider.setOrientation(JSlider.VERTICAL); 
    205                 zSlider.setPaintTicks(true); 
    206                 zSlider.setPaintLabels(true); 
     206                zSlider.setPaintTicks(false); 
     207                zSlider.setPaintLabels(false); 
    207208                zSlider.setMajorTickSpacing(1); 
    208209                zSlider.addChangeListener(this); 
    … …  
    214215 
    215216                tSlider = new OneKnobSlider(); 
    216                 tSlider.setPaintTicks(true); 
    217                 tSlider.setPaintLabels(true); 
     217                tSlider.setPaintTicks(false); 
     218                tSlider.setPaintLabels(false); 
    218219                tSlider.setMajorTickSpacing(1); 
    219220                tSlider.setSnapToTicks(true); 
  • trunk/SRC/org/openmicroscopy/shoola/agents/measurement/view/IntensityView.java

    r5374 r5674  
    2828import java.awt.Color; 
    2929import java.awt.Dimension; 
     30import java.awt.Point; 
    3031import java.awt.event.ActionEvent; 
    3132import java.awt.event.ActionListener; 
    … …  
    6061import org.openmicroscopy.shoola.agents.measurement.MeasurementAgent; 
    6162import org.openmicroscopy.shoola.util.filter.file.CSVFilter; 
    62 import org.openmicroscopy.shoola.util.math.geom2D.PlanePoint2D; 
    6363import org.openmicroscopy.shoola.util.roi.figures.MeasureBezierFigure; 
    6464import org.openmicroscopy.shoola.util.roi.figures.MeasureEllipseFigure; 
    … …  
    101101        implements ActionListener, TabPaneInterface, ChangeListener 
    102102{ 
     103         
    103104        /** Index to identify tab */ 
    104105        public final static int         INDEX = MeasurementViewerUI.INTENSITY_INDEX; 
    … …  
    118119        /** The intial size of the intensity table dialog. */ 
    119120        private Dimension intensityTableSize = new Dimension(300,300); 
    120          
    121          
     121 
    122122        /** The state of the Intensity View. */ 
    123123        static enum State  
    … …  
    218218 
    219219        /** Map of the pixel intensity values to coord. */ 
    220         TreeMap<Coord3D, Map<Integer, Map<PlanePoint2D, Double>>> pixelStats; 
     220        private TreeMap<Coord3D, Map<Integer, Map<Point, Double>>> pixelStats; 
    221221         
    222222        /** Map of the min channel intensity values to coord. */ 
    223         TreeMap<Coord3D, Map<Integer, Double>> minStats; 
     223        private TreeMap<Coord3D, Map<Integer, Double>> minStats; 
    224224 
    225225        /** Map of the max channel intensity values to coord. */ 
    226         TreeMap<Coord3D, Map<Integer, Double>> maxStats; 
     226        private TreeMap<Coord3D, Map<Integer, Double>> maxStats; 
    227227 
    228228        /** Map of the mean channel intensity values to coord. */ 
    229         TreeMap<Coord3D, Map<Integer, Double>> meanStats; 
     229        private TreeMap<Coord3D, Map<Integer, Double>> meanStats; 
    230230         
    231231        /** Map of the std dev channel intensity values to coord. */ 
    232         TreeMap<Coord3D, Map<Integer, Double>> stdDevStats; 
     232        private TreeMap<Coord3D, Map<Integer, Double>> stdDevStats; 
    233233         
    234234        /** Map of the sum channel intensity values to coord. */ 
    235         TreeMap<Coord3D, Map<Integer, Double>> sumStats; 
     235        private TreeMap<Coord3D, Map<Integer, Double>> sumStats; 
    236236         
    237237        /** Map of the coord to a shape. */ 
    238         TreeMap<Coord3D, ROIShape> shapeMap; 
     238        private TreeMap<Coord3D, ROIShape> shapeMap; 
    239239         
    240240        /** The current coord of the ROI being depicted in the slider. */ 
    241         Coord3D coord; 
     241        private Coord3D                                 coord; 
    242242         
    243243        /** Button for the calling of the intensity table. */ 
    244         JButton showIntensityTable; 
     244        private JButton                                 showIntensityTable; 
    245245         
    246246        /** Current ROIShape. */ 
    247         private         ROIShape shape; 
     247        private ROIShape                                shape; 
    248248         
    249249        /** Dialog showing the intensity values for the selected channel. */ 
    250         private IntensityValuesDialog intensityDialog; 
     250        private IntensityValuesDialog   intensityDialog; 
    251251         
    252252        /** Table Model. */ 
    253         private IntensityModel                          tableModel; 
     253        private IntensityModel                  tableModel; 
    254254 
    255255        /** 
    … …  
    287287                zSlider = new OneKnobSlider(); 
    288288                zSlider.setOrientation(JSlider.VERTICAL); 
    289                 zSlider.setPaintTicks(true); 
    290                 zSlider.setPaintLabels(true); 
     289                zSlider.setPaintTicks(false); 
     290                zSlider.setPaintLabels(false); 
    291291                zSlider.setMajorTickSpacing(1); 
    292292                zSlider.addChangeListener(this); 
    … …  
    297297 
    298298                tSlider = new OneKnobSlider(); 
    299                 tSlider.setPaintTicks(true); 
    300                 tSlider.setPaintLabels(true); 
     299                tSlider.setPaintTicks(false); 
     300                tSlider.setPaintLabels(false); 
    301301                tSlider.setMajorTickSpacing(1); 
    302302                tSlider.setSnapToTicks(true); 
    … …  
    427427                 
    428428                shapeStatsList = new TreeMap<Coord3D, Map<StatsType, Map>>(new Coord3D()); 
    429                 pixelStats = new TreeMap<Coord3D, Map<Integer, Map<PlanePoint2D, Double>>>(new Coord3D()); 
     429                pixelStats = new TreeMap<Coord3D, Map<Integer, Map<Point, Double>>>(new Coord3D()); 
    430430                shapeMap = new TreeMap<Coord3D, ROIShape>(new Coord3D()); 
    431431                minStats = new TreeMap<Coord3D, Map<Integer, Double>>(new Coord3D()); 
    … …  
    634634         * @param count the column the data is being placed in. 
    635635         */ 
    636         private void populateSummaryColumn(ROIFigure fig, Double data[][], int channel, int count) 
     636        private void populateSummaryColumn(ROIFigure fig, Double data[][],  
     637                        int channel, int count) 
    637638        { 
    638639                data[count][0] = channelMin.get(channel); 
    … …  
    641642                data[count][3] = channelMean.get(channel); 
    642643                data[count][4] = channelStdDev.get(channel); 
    643                 data[count][5] = (double)fig.getPoints().length; 
     644                data[count][5] = (double)fig.getPoints().size(); 
    644645                if(areaFigure(fig)) 
    645646                        addValuesForAreaFigure(fig, data, channel, count); 
    … …  
    745746        private void interpretResults(Coord3D coord, int channel) 
    746747        { 
    747                 Map<PlanePoint2D, Double> pixels=pixelStats.get(coord).get(channel); 
     748                Map<Point, Double> pixels = pixelStats.get(coord).get(channel); 
    748749                if (pixels==null) return; 
    749                 Iterator<PlanePoint2D> pixelIterator=pixels.keySet().iterator(); 
     750                Iterator<Point> pixelIterator = pixels.keySet().iterator(); 
    750751                double minX, maxX, minY, maxY; 
    751752                if (!pixelIterator.hasNext()) return; 
    752                 PlanePoint2D point=pixelIterator.next(); 
    753                 minX=(point.getX()); 
    754                 maxX=(point.getX()); 
    755                 minY=(point.getY()); 
    756                 maxY=(point.getY()); 
     753                Point point = pixelIterator.next(); 
     754                minX = (point.getX()); 
     755                maxX = (point.getX()); 
     756                minY = (point.getY()); 
     757                maxY = (point.getY()); 
    757758                while (pixelIterator.hasNext()) 
    758759                { 
    759                         point=pixelIterator.next(); 
    760                         minX=Math.min(minX, point.getX()); 
    761                         maxX=Math.max(maxX, point.getX()); 
    762                         minY=Math.min(minY, point.getY()); 
    763                         maxY=Math.max(maxY, point.getY()); 
     760                        point = pixelIterator.next(); 
     761                        minX = Math.min(minX, point.getX()); 
     762                        maxX = Math.max(maxX, point.getX()); 
     763                        minY = Math.min(minY, point.getY()); 
     764                        maxY = Math.max(maxY, point.getY()); 
    764765                } 
    765766                int sizeX, sizeY; 
    766                 sizeX=(int) (maxX-minX)+1; 
    767                 sizeY=(int) ((maxY-minY)+1); 
    768                 Double[][] data=new Double[sizeX][sizeY]; 
    769                 pixelIterator=pixels.keySet().iterator(); 
     767                sizeX = (int) (maxX-minX)+1; 
     768                sizeY = (int) ((maxY-minY)+1); 
     769                Double[][] data = new Double[sizeX][sizeY]; 
     770                pixelIterator = pixels.keySet().iterator(); 
    770771                int x, y; 
     772                Double value; 
    771773                while (pixelIterator.hasNext()) 
    772774                { 
    773                         point=pixelIterator.next(); 
    774                         x=(int) (point.getX()-minX); 
    775                         y=(int) (point.getY()-minY); 
    776                         if (x>=sizeX||y>=sizeY) continue; 
    777                         Double value; 
    778                         if (pixels.containsKey(point)) value=pixels.get(point); 
    779                         else value=new Double(0); 
    780                         data[x][y]=value; 
    781                 } 
    782                 channelMin=minStats.get(coord); 
    783                 channelMax=maxStats.get(coord); 
    784                 channelMean=meanStats.get(coord); 
    785                 channelStdDev=stdDevStats.get(coord); 
    786                 channelSum=sumStats.get(coord); 
    787                 tableModel=new IntensityModel(data); 
    788                 shape=shapeMap.get(coord); 
     775                        point = pixelIterator.next(); 
     776                        x = (int) (point.getX()-minX); 
     777                        y = (int) (point.getY()-minY); 
     778                        if (x >= sizeX || y >= sizeY) continue; 
     779                         
     780                        if (pixels.containsKey(point)) value = pixels.get(point); 
     781                        else value = new Double(0); 
     782                        data[x][y] = value; 
     783                } 
     784                channelMin = minStats.get(coord); 
     785                channelMax = maxStats.get(coord); 
     786                channelMean = meanStats.get(coord); 
     787                channelStdDev = stdDevStats.get(coord); 
     788                channelSum = sumStats.get(coord); 
     789                tableModel = new IntensityModel(data); 
     790                shape = shapeMap.get(coord); 
    789791                intensityDialog.setModel(tableModel); 
    790792        } 
  • trunk/SRC/org/openmicroscopy/shoola/agents/measurement/view/MeasurementViewer.java

    r5641 r5674  
    2727import java.awt.image.BufferedImage; 
    2828import java.io.InputStream; 
    29 import java.util.ArrayList; 
    3029import java.util.Collection; 
    3130import java.util.List; 
    … …  
    4140import org.openmicroscopy.shoola.util.roi.model.ROIShape; 
    4241import org.openmicroscopy.shoola.util.ui.component.ObservableComponent; 
    43  
    4442import pojos.PixelsData; 
    4543 
    … …  
    7573    public static final int     ANALYSE_SHAPE = 4; 
    7674     
    77     /** Flag to denote the <i>Analyse roi</i> state. */ 
    78     public static final int     ANALYSE_ROI = 5; 
    79      
    8075    /** Flag to denote the <i>Ready</i> state. */ 
    81     public static final int     READY = 6; 
     76    public static final int     READY = 5; 
    8277     
    8378    /** Flag to denote the <i>Discarded</i> state. */ 
    84     public static final int     DISCARDED = 7; 
     79    public static final int     DISCARDED = 6; 
    8580 
    8681    /** Flag to denote the <i>Value adjusting</i> state. */ 
    87     public static final int     VALUE_ADJUSTING = 8; 
     82    public static final int     VALUE_ADJUSTING = 7; 
    8883  
    8984    /** 
    … …  
    231226         
    232227        /** 
    233          * Analyses the specifed shape. 
    234          *  
    235          * @param shape The shape to analyse. Mustn't be <code>null</code>. 
    236          */ 
    237         //public void analyseShape(ROIShape shape); 
    238  
    239         /** 
    240228         * Analyses the specifed list of ROIShapes. 
    241229         *  
    242          * @param shape The list of ROIShapes to analyse. Mustn't be <code>null</code>. 
    243          */ 
    244         public void analyseShapeList(ArrayList<ROIShape> shape); 
    245  
    246          
    247         /** 
    248          * Analyses the specifed ROI. 
    249          *  
    250          * @param roi The shape to analyse. Mustn't be <code>null</code>. 
    251          */ 
    252         //public void analyseROI(ROI roi); 
     230         * @param shape The list of ROIShapes to analyse.  
     231         *                              Mustn't be <code>null</code>. 
     232         */ 
     233        public void analyseShapeList(List<ROIShape> shape); 
    253234 
    254235        /** 
  • trunk/SRC/org/openmicroscopy/shoola/agents/measurement/view/MeasurementViewerComponent.java

    r5641 r5674  
    551551                } 
    552552                model.setActiveChannels(activeChannels); 
    553                 if (view.inDataView()){ 
    554                         Collection<ROIFigure> collection = getSelectedFigures(); 
    555                         if (collection.size() != 1) return; 
    556                         ROIFigure figure = collection.iterator().next(); 
    557                         ArrayList<ROIShape> shapeList = new ArrayList<ROIShape>(); 
    558                         ROI roi = figure.getROI(); 
    559                         TreeMap<Coord3D, ROIShape> shapeMap = roi.getShapes(); 
    560                         Iterator<Coord3D> shapeIterator = shapeMap.keySet().iterator(); 
    561                         while(shapeIterator.hasNext()) 
    562                                 shapeList.add(shapeMap.get(shapeIterator.next())); 
    563                         if(shapeList.size()!=0) 
    564                         analyseShapeList(shapeList); 
    565                 } 
     553                 
     554                if (!view.inDataView()) return; 
     555                Collection<ROIFigure> collection = getSelectedFigures(); 
     556                if (collection.size() != 1) return; 
     557                 
     558                ROIFigure figure = collection.iterator().next(); 
     559                ArrayList<ROIShape> shapeList = new ArrayList<ROIShape>(); 
     560                ROI roi = figure.getROI(); 
     561                TreeMap<Coord3D, ROIShape> shapeMap = roi.getShapes(); 
     562                Iterator<Coord3D> shapeIterator = shapeMap.keySet().iterator(); 
     563                while (shapeIterator.hasNext()) 
     564                        shapeList.add(shapeMap.get(shapeIterator.next())); 
     565                 
     566                if (shapeList.size() != 0) analyseShapeList(shapeList); 
    566567        } 
    567568 
    … …  
    581582                } 
    582583                model.setActiveChannels(channels); 
    583                 if (view.inDataView()) { 
    584                         Collection<ROIFigure> collection = getSelectedFigures(); 
    585                         if (collection.size() != 1) return; 
    586                         ROIFigure figure = collection.iterator().next(); 
    587                         ArrayList<ROIShape> shapeList = new ArrayList<ROIShape>(); 
    588                         ROI roi = figure.getROI(); 
    589                         TreeMap<Coord3D, ROIShape> shapeMap = roi.getShapes(); 
    590                         Iterator<Coord3D> shapeIterator = shapeMap.keySet().iterator(); 
    591                         while(shapeIterator.hasNext()) 
    592                                 shapeList.add(shapeMap.get(shapeIterator.next())); 
    593                         if(shapeList.size()!=0) 
    594                         analyseShapeList(shapeList); 
    595                 } 
     584                if (!view.inDataView()) return; 
     585                Collection<ROIFigure> collection = getSelectedFigures(); 
     586                if (collection.size() != 1) return; 
     587                 
     588                ROIFigure figure = collection.iterator().next(); 
     589                ArrayList<ROIShape> shapeList = new ArrayList<ROIShape>(); 
     590                ROI roi = figure.getROI(); 
     591                TreeMap<Coord3D, ROIShape> shapeMap = roi.getShapes(); 
     592                Iterator<Coord3D> shapeIterator = shapeMap.keySet().iterator(); 
     593                while(shapeIterator.hasNext()) 
     594                        shapeList.add(shapeMap.get(shapeIterator.next())); 
     595                if (shapeList.size()!=0) analyseShapeList(shapeList); 
    596596        } 
    597597 
    … …  
    620620                fireStateChange(); 
    621621        } 
    622          
    623         /**  
    624          * Implemented as specified by the {@link MeasurementViewer} interface. 
    625          * @see MeasurementViewer#analyseShape(ROIShape) 
    626          */ 
    627         /*public void analyseShape(ROIShape shape) 
    628         { 
    629                 if (shape == null) 
    630                         throw new IllegalArgumentException("No shape specified."); 
    631                 int state = model.getState(); 
    632                 switch (model.getState()) { 
    633                         case DISCARDED: 
    634                         case LOADING_DATA: 
    635                         case LOADING_ROI: 
    636                                 throw new IllegalStateException("This method cannot be " + 
    637                                                 "invoked in the DISCARDED, LOADING_DATA or " + 
    638                                                 "LOADING_ROI state: "+state); 
    639                                  
    640                         case ANALYSE_SHAPE: 
    641                                 model.cancel(); 
    642                                 break; 
    643                 } 
    644                 if (model.getActiveChannels().size() == 0) return; 
    645                 model.fireAnalyzeShape(shape); 
    646                 fireStateChange(); 
    647         }*/ 
    648          
    649         /**  
    650          * Imp