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

Method getStack

ij/src/main/java/ij/ImagePlus.java:1879–1913  ·  view source on GitHub ↗

Returns the image stack. The stack may have only one slice. After adding or removing slices, call setStack() to update the image and the window that is displaying it. @see #setStack

()

Source from the content-addressed store, hash-verified

1877 @see #setStack
1878 */
1879 public ImageStack getStack() {
1880 ImageStack s;
1881 if (stack==null) {
1882 s = createEmptyStack();
1883 ImageProcessor ip2 = getProcessor();
1884 if (ip2==null)
1885 return s;
1886 String label = getProp("Slice_Label");
1887 if (label==null) {
1888 String info = (String)getProperty("Info");
1889 label = info!=null?getTitle()+"\n"+info:null; // DICOM metadata
1890 }
1891 s.addSlice(label, ip2);
1892 s.update(ip2);
1893 this.stack = s;
1894 ip = ip2;
1895 oneSliceStack = true;
1896 setCurrentSlice(1);
1897 } else {
1898 s = stack;
1899 if (ip!=null) {
1900 Calibration cal = getCalibration();
1901 if (cal.calibrated())
1902 ip.setCalibrationTable(cal.getCTable());
1903 else
1904 ip.setCalibrationTable(null);
1905 }
1906 s.update(ip);
1907 }
1908 if (roi!=null)
1909 s.setRoi(roi.getBounds());
1910 else
1911 s.setRoi(null);
1912 return s;
1913 }
1914
1915 /** Returns the base image stack. */
1916 public ImageStack getImageStack() {

Callers 15

ImagePlusMethod · 0.95
updateVirtualSliceMethod · 0.95
invertLookupTableMethod · 0.95
getStringPropertyMethod · 0.95
getImageStackMethod · 0.95
revertMethod · 0.95
revertStackMethod · 0.95
getFileInfoMethod · 0.95
flattenStackMethod · 0.95
getProcessorMethod · 0.95
updateMenusMethod · 0.95
setZCoordinateMethod · 0.95

Calls 14

createEmptyStackMethod · 0.95
getProcessorMethod · 0.95
getPropMethod · 0.95
getPropertyMethod · 0.95
getTitleMethod · 0.95
addSliceMethod · 0.95
updateMethod · 0.95
setCurrentSliceMethod · 0.95
getCalibrationMethod · 0.95
calibratedMethod · 0.95
getCTableMethod · 0.95
setRoiMethod · 0.95

Tested by

no test coverage detected