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

Method showDialog

ij/src/main/java/ij/io/ImportDialog.java:74–127  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

72 }
73
74 boolean showDialog() {
75 boolean macro = Macro.getOptions()!=null;
76 if (macro) {
77 width = height = 512;
78 offset = gapBetweenImages = 0;
79 nImages = 1;
80 whiteIsZero = intelByteOrder = virtual = false;
81 }
82 if (choiceSelection>=types.length)
83 choiceSelection = 0;
84 getDimensionsFromName(fileName);
85 GenericDialog gd = new GenericDialog("Import>Raw...");
86 gd.addChoice("Image type:", types, types[choiceSelection]);
87 gd.addNumericField("Width:", width, 0, 8, "pixels");
88 gd.addNumericField("Height:", height, 0, 8, "pixels");
89 gd.addNumericField("Offset to first image:", offset, 0, 8, "bytes");
90 gd.addNumericField("Number of images:", nImages, 0, 8, null);
91 gd.addNumericField("Gap between images:", gapBetweenImages, 0, 8, "bytes");
92 gd.addCheckbox("White is zero", whiteIsZero);
93 gd.addCheckbox("Little-endian byte order", intelByteOrder);
94 gd.addCheckbox("Open all files in folder", openAll);
95 gd.addCheckbox("Use virtual stack", virtual);
96 gd.addHelp(IJ.URL2+"/docs/menus/file.html#raw");
97 gd.showDialog();
98 if (gd.wasCanceled())
99 return false;
100 choiceSelection = gd.getNextChoiceIndex();
101 width = (int)gd.getNextNumber();
102 height = (int)gd.getNextNumber();
103 gd.setSmartRecording(offset==0);
104 offset = (long)gd.getNextNumber();
105 gd.setSmartRecording(nImages==1);
106 nImages = (int)gd.getNextNumber();
107 gd.setSmartRecording(gapBetweenImages==0);
108 gapBetweenImages = (long)gd.getNextNumber();
109 gd.setSmartRecording(false);
110 whiteIsZero = gd.getNextBoolean();
111 intelByteOrder = gd.getNextBoolean();
112 openAll = gd.getNextBoolean();
113 virtual = gd.getNextBoolean();
114 IJ.register(ImportDialog.class);
115 if (!macro) {
116 sChoiceSelection = choiceSelection;
117 sWidth = width;
118 sHeight = height;
119 sOffset = offset;
120 sNImages = nImages;
121 sGapBetweenImages = gapBetweenImages;
122 sWhiteIsZero = whiteIsZero;
123 sIntelByteOrder = intelByteOrder;
124 sVirtual = virtual;
125 }
126 return true;
127 }
128
129 /** Opens all the images in the directory. */
130 void openAll(String directory, String[] list, FileInfo fi) {

Callers 1

getFileInfoMethod · 0.95

Calls 13

getOptionsMethod · 0.95
getDimensionsFromNameMethod · 0.95
addChoiceMethod · 0.95
addNumericFieldMethod · 0.95
addCheckboxMethod · 0.95
addHelpMethod · 0.95
showDialogMethod · 0.95
wasCanceledMethod · 0.95
getNextChoiceIndexMethod · 0.95
getNextNumberMethod · 0.95
setSmartRecordingMethod · 0.95
getNextBooleanMethod · 0.95

Tested by

no test coverage detected