MCPcopy Create free account
hub / github.com/AstroImageJ/astroimagej / saveRoi

Method saveRoi

ij/src/main/java/ij/plugin/filter/RoiWriter.java:35–52  ·  view source on GitHub ↗
(ImagePlus imp)

Source from the content-addressed store, hash-verified

33 }
34
35 public void saveRoi(ImagePlus imp) throws IOException{
36 Roi roi = imp.getRoi();
37 if (roi==null)
38 throw new IllegalArgumentException("ROI required");
39 String name = roi.getName();
40 if (name==null)
41 name = imp.getTitle();
42 SaveDialog sd = new SaveDialog("Save Selection...", name, ".roi");
43 name = sd.getFileName();
44 if (name == null)
45 return;
46 String dir = sd.getDirectory();
47 RoiEncoder re = new RoiEncoder(dir+name);
48 re.write(roi);
49 if (name.endsWith(".roi"))
50 name = name.substring(0, name.length()-4);
51 roi.setName(name);
52 }
53
54}

Callers 5

runMethod · 0.95
makeOvalMethod · 0.45
makeRectangleMethod · 0.45
runMethod · 0.45
runMethod · 0.45

Calls 9

getNameMethod · 0.95
getFileNameMethod · 0.95
getDirectoryMethod · 0.95
writeMethod · 0.95
setNameMethod · 0.95
substringMethod · 0.80
getTitleMethod · 0.65
lengthMethod · 0.65
getRoiMethod · 0.45

Tested by

no test coverage detected