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

Method setProcessor2

ij/src/main/java/ij/ImagePlus.java:881–924  ·  view source on GitHub ↗
(String title, ImageProcessor ip, ImageStack newStack)

Source from the content-addressed store, hash-verified

879 }
880
881 @AstroImageJ(reason = "Remove ip null check, add check for PlotWindow", modified = true)
882 void setProcessor2(String title, ImageProcessor ip, ImageStack newStack) {
883 if (title!=null) setTitle(title);
884 if (ip==null)
885 return;
886 this.ip = ip;
887 if (getWindow()!=null && !(getWindow() instanceof PlotWindow))
888 notifyListeners(UPDATED);
889 if (ij!=null)
890 ip.setProgressBar(ij.getProgressBar());
891 int stackSize = 1;
892 boolean dimensionsChanged = width>0 && height>0 && (width!=ip.getWidth() || height!=ip.getHeight());
893 if (stack!=null) {
894 stackSize = stack.size();
895 if (currentSlice>stackSize)
896 setCurrentSlice(stackSize);
897 if (currentSlice>=1 && currentSlice<=stackSize && !dimensionsChanged)
898 stack.setPixels(ip.getPixels(),currentSlice);
899 }
900 img = null;
901 if (dimensionsChanged) roi = null;
902 int type;
903 if (ip instanceof ByteProcessor)
904 type = GRAY8;
905 else if (ip instanceof ColorProcessor)
906 type = COLOR_RGB;
907 else if (ip instanceof ShortProcessor)
908 type = GRAY16;
909 else
910 type = GRAY32;
911 if (width==0)
912 imageType = type;
913 else
914 setType(type);
915 width = ip.getWidth();
916 height = ip.getHeight();
917 if (win!=null) {
918 if (dimensionsChanged && stackSize==1)
919 win.updateImage(this);
920 else if (newStack==null)
921 repaintWindow();
922 draw();
923 }
924 }
925
926 /** Replaces the image with the specified stack and updates the display. */
927 public void setStack(ImageStack stack) {

Callers 2

setProcessorMethod · 0.95
setStackMethod · 0.95

Calls 15

setTitleMethod · 0.95
getWindowMethod · 0.95
notifyListenersMethod · 0.95
setCurrentSliceMethod · 0.95
setTypeMethod · 0.95
repaintWindowMethod · 0.95
drawMethod · 0.95
setProgressBarMethod · 0.80
getProgressBarMethod · 0.80
getWidthMethod · 0.45
getHeightMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected