~ubuntu-branches/ubuntu/quantal/pixelmed/quantal

« back to all changes in this revision

Viewing changes to com/pixelmed/display/DicomBrowser.java

  • Committer: Package Import Robot
  • Author(s): Mathieu Malaterre
  • Date: 2012-05-08 15:25:52 UTC
  • mfrom: (1.2.9)
  • Revision ID: package-import@ubuntu.com-20120508152552-5hbvqwn08q7jx26i
Tags: 20120405-1
* New upstream
* Use my @d.o alias
* fix issue with encapsulated DICOM files (need libjai-imageio-core-java)
* Add missing jmdns.jar in manifest file

Show diffs side-by-side

added added

removed removed

Lines of Context:
33
33
 */
34
34
public class DicomBrowser extends ApplicationFrame {
35
35
 
36
 
        private static final String identString = "@(#) $Header: /userland/cvs/pixelmed/imgbook/com/pixelmed/display/DicomBrowser.java,v 1.25 2012/02/01 23:02:09 dclunie Exp $";
 
36
        private static final String identString = "@(#) $Header: /userland/cvs/pixelmed/imgbook/com/pixelmed/display/DicomBrowser.java,v 1.26 2012/03/14 18:35:27 dclunie Exp $";
37
37
 
38
38
        /***/
39
39
        public DicomBrowser() { 
175
175
                                Vector preDefinedShapes = null;
176
176
                                Vector preDefinedText = null;
177
177
                                if (coords != null ) {
178
 
//System.err.println("["+count+"] = "+coords[count]);
 
178
System.err.println("["+count+"] = "+coords[count]);
179
179
                                        SpatialCoordinateAndImageReference reference=coords[count];
180
180
                                        if (reference != null) {
181
181
                                                String graphicType=reference.getGraphicType();
182
182
                                                float[] graphicData=reference.getGraphicData();
183
183
                                                if (graphicType !=null && graphicData != null) {
 
184
System.err.println("loadAndDisplayImagesFromSOPInstances(): initializing new vectors of preDefinedShapes and preDefinedText");
184
185
                                                        preDefinedShapes = new Vector();
185
186
                                                        preDefinedText = new Vector();
186
187
                                                        if (graphicType.equals("POINT") && graphicData.length == 2) {
187
 
//System.err.println("loadAndDisplayImagesFromSOPInstances(): adding POINT");
 
188
System.err.println("loadAndDisplayImagesFromSOPInstances(): adding POINT");
188
189
                                                                int x = (int)graphicData[0];
189
190
                                                                int y = (int)graphicData[1];
190
191
                                                                DrawingUtilities.addDiagonalCross(preDefinedShapes,x,y,crossSize,crossGap);
191
192
                                                                preDefinedText.add(new TextAnnotation(reference.getAnnotation(),x+textHorizontalOffset,y+textVerticalOffset));
192
193
                                                        }
193
194
                                                        else if (graphicType.equals("MULTIPOINT") && graphicData.length%2 == 0) {
194
 
//System.err.println("loadAndDisplayImagesFromSOPInstances(): adding MULTIPOINT");
 
195
System.err.println("loadAndDisplayImagesFromSOPInstances(): adding MULTIPOINT");
195
196
                                                                for (int index=0; index < graphicData.length; index+=2) {
 
197
System.err.println("loadAndDisplayImagesFromSOPInstances(): adding MULTIPOINT point at ("+graphicData[index]+","+graphicData[index+1]+")");
196
198
                                                                        DrawingUtilities.addDiagonalCross(preDefinedShapes,(int)graphicData[index],(int)graphicData[index+1],crossSize,crossGap);
197
199
                                                                }
 
200
System.err.println("loadAndDisplayImagesFromSOPInstances(): adding MULTIPOINT text: "+reference.getAnnotation());
198
201
                                                                preDefinedText.add(new TextAnnotation(reference.getAnnotation(),(int)graphicData[0]+textHorizontalOffset,(int)graphicData[1]+textVerticalOffset));
199
202
                                                        }
200
203
                                                        else if (graphicType.equals("POLYLINE") && graphicData.length == 4) {
201
 
//System.err.println("loadAndDisplayImagesFromSOPInstances(): adding POLYLINE with two points");
 
204
System.err.println("loadAndDisplayImagesFromSOPInstances(): adding POLYLINE with two points");
202
205
                                                                int x1 = (int)graphicData[0];
203
206
                                                                int y1 = (int)graphicData[1];
204
207
                                                                int x2 = (int)graphicData[2];
216
219
                                                                preDefinedText.add(new TextAnnotation(reference.getAnnotation(),useX+textHorizontalOffset,useY+textVerticalOffset));
217
220
                                                        }
218
221
                                                        else if (graphicType.equals("POLYLINE") && graphicData.length > 4) {
219
 
//System.err.println("loadAndDisplayImagesFromSOPInstances(): adding POLYLINE wiht more than two points");
 
222
System.err.println("loadAndDisplayImagesFromSOPInstances(): adding POLYLINE with more than two points");
220
223
                                                                int x1 = (int)graphicData[0];
221
224
                                                                int y1 = (int)graphicData[1];
222
225
                                                                for (int p=2; p+1 < graphicData.length; p+=2) {
229
232
                                                                preDefinedText.add(new TextAnnotation(reference.getAnnotation(),x1+textHorizontalOffset,y1+textVerticalOffset));
230
233
                                                        }
231
234
                                                        else if (graphicType.equals("ELLIPSE") && graphicData.length == 8) {
232
 
//System.err.println("loadAndDisplayImagesFromSOPInstances(): adding ELLIPSE");
 
235
System.err.println("loadAndDisplayImagesFromSOPInstances(): adding ELLIPSE");
233
236
                                                                int xmajorstart = (int)graphicData[0];
234
237
                                                                int ymajorstart = (int)graphicData[1];
235
238
                                                                int xmajorend = (int)graphicData[2];
257
260
                                                                        preDefinedText.add(new TextAnnotation(reference.getAnnotation(),xtopleft+textHorizontalOffset,ytopleft+textVerticalOffset));
258
261
                                                                }
259
262
                                                                else {
260
 
//System.err.println("loadAndDisplayImagesFromSOPInstances(): NOT adding ELLIPSE that is not parallel to row"); // because the constructor expects a rectangular area :(
 
263
System.err.println("loadAndDisplayImagesFromSOPInstances(): NOT adding ELLIPSE that is not parallel to row");   // because the constructor expects a rectangular area :(
261
264
                                                                }
262
265
                                                        }
263
266
                                                        else if (graphicType.equals("CIRCLE") && graphicData.length == 4) {
264
 
//System.err.println("loadAndDisplayImagesFromSOPInstances(): adding CIRCLE");
 
267
System.err.println("loadAndDisplayImagesFromSOPInstances(): adding CIRCLE");
265
268
                                                                int xcenter = (int)graphicData[0];
266
269
                                                                int ycenter = (int)graphicData[1];
267
270
                                                                int xperimeter = (int)graphicData[2];
281
284
                                                }
282
285
                                        }
283
286
                                }
 
287
System.err.println("loadAndDisplayImagesFromSOPInstances(): pre-defined shapes passed to SingleImagePanel constructor");
 
288
com.pixelmed.geometry.LocalizerPosterFactory.dumpShapes(preDefinedShapes);
284
289
                                SingleImagePanel ip = new SingleImagePanel(sImg,null/*EventContext*/,null/*sortOrder*/,preDefinedShapes,preDefinedText,null/*GeometryOfVolume*/);
285
290
                                ip.setPreferredSize(new Dimension(sImg.getWidth(),sImg.getHeight()));
286
291
                                multiPanel.add(ip);