Skip to content

Commit

Permalink
fixed element and timepoint deletion
Browse files Browse the repository at this point in the history
  • Loading branch information
RainerHeintzmann committed Aug 17, 2022
1 parent a14ba21 commit 7b7e285
Show file tree
Hide file tree
Showing 46 changed files with 100 additions and 28 deletions.
Binary file modified View5D.jar
Binary file not shown.
7 changes: 4 additions & 3 deletions javacImageJ
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@ cd src
# javac -target 1.1 -deprecation View5D_.java
cp view5d/View5D_.java view5d/aaa.class
rm view5d/*.class
javac -target 1.8 -source 1.8 -deprecation -classpath ".:/usr/local/ImageJ/ij.jar" view5d/View5D_.java view5d/View5D.java # -target 1.4 -source 1.2
javac -target 1.8 -source 1.8 -deprecation -classpath ".:/usr/share/java/ij.jar" view5d/View5D_.java view5d/View5D.java # -target 1.4 -source 1.2
# javac -deprecation -classpath "." View5D_.java
jar -cf View5D_.jar view5d/*.class plugins.config
jar -cf /tmp/View5D_.jar view5d/*.class plugins.config
cp /tmp/View5D_.jar .
# cp /*.class /usr/local/ImageJ/plugins/View5D/
cp View5D_.jar /mnt/c/Users/pi96doc/Desktop/Fiji.app/plugins/View5D_-2.3.7.jar
cp View5D_.jar /mnt/c/Users/pi96doc/Desktop/UserPrograms/fiji-win64/Fiji.app/plugins/View5D_-2.3.8.jar

# cp View5D_.jar /usr/local/ImageJ/plugins/View5D/
# cp View5D_.jar /windows/C/DriveF/JavaProgs/ImageJ/plugins/View5D/
Expand Down
10 changes: 6 additions & 4 deletions javacPython
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@ cd src
cp view5d/View5D_.java view5d/aaa.class
rm view5d/*.class
# javac -target 1.5 -source 1.5 -deprecation -classpath ".:/usr/local/ImageJ/ij.jar" view5d/View5D_.java view5d/View5D.java # -target 1.4 -source 1.2
javac -target 1.6 -source 1.6 -deprecation -classpath ".:/usr/local/ImageJ/ij.jar" view5d/View5D_.java view5d/View5D.java # -target 1.4 -source 1.2
# javac -target 1.6 -source 1.6 -deprecation -classpath ".:/usr/local/ImageJ/ij.jar" view5d/View5D_.java view5d/View5D.java # -target 1.4 -source 1.2
javac -target 1.6 -source 1.6 -deprecation -classpath ".:/usr/share/java/ij.jar" view5d/View5D_.java view5d/View5D.java # -target 1.4 -source 1.2
# javac -deprecation -classpath "." View5D_.java
jar -cf View5D_.jar view5d/*.class plugins.config
jar -cf /tmp/View5D_.jar view5d/*.class plugins.config
cp /tmp/View5D_.jar .
cp View5D_.jar ../../../PythonScripts/FromWeb/nanoimagingpack/NanoImagingPack/resources/
cp View5D_.jar "/mnt/c/NoBackup/DeconvCompileTest/DIPlib_3_2017/share/DIPimage/private/View5D.jar"
cp View5D_.jar "/mnt/c/NoBackup/DeconvCompileTest/DIPlib_3_2019/share/DIPimage/private/View5D.jar"
Expand All @@ -19,8 +21,8 @@ cp View5D_.jar "C:\Program Files\DIPlib_3_2019\share\DIPimage\private\View5D.jar
cp View5D_.jar " C:\NoBackup\DeconvCompileTest\DIPlib_3_2019\share\DIPimage\private\View5D.jar"
cp View5D_.jar " C:\NoBackup\DeconvCompileTest\DIPlib_3_2017\share\DIPimage\private\View5D.jar"
cd ..
cp View5D.jar "View5D_v2.3.7.jar"
tar -czf "View5D_v2.3.7-jar.tar.gz" "View5D_v2.3.7.jar"
cp View5D.jar "View5D_v2.3.8.jar"
tar -czf "View5D_v2.3.8-jar.tar.gz" "View5D_v2.3.8.jar"
# cp /*.class /usr/local/ImageJ/plugins/View5D/
#cp View5D_.jar /usr/local/ImageJ/plugins/View5D/
# cp View5D_.jar /windows/C/DriveF/JavaProgs/ImageJ/plugins/View5D/
Expand Down
Binary file modified src/View5D_.jar
Binary file not shown.
Binary file modified src/view5d/AGenericDialog.class
Binary file not shown.
Binary file modified src/view5d/ANGenericDialog.class
Binary file not shown.
Binary file modified src/view5d/APoint.class
Binary file not shown.
Binary file modified src/view5d/ASlice.class
Binary file not shown.
Binary file modified src/view5d/AlternateViewer.class
Binary file not shown.
Binary file modified src/view5d/AnElement.class
Binary file not shown.
Binary file modified src/view5d/Bundle.class
Binary file not shown.
2 changes: 1 addition & 1 deletion src/view5d/Bundle.java
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ public void GenCMap() {

public static int AddLookUpTable(int TableSize, byte reds[], byte greens[], byte blues[])
{
MapSizes.addElement(new Integer(TableSize));
MapSizes.addElement(Integer.valueOf(TableSize));
RedMaps.addElement(reds);
GreenMaps.addElement(greens);
BlueMaps.addElement(blues);
Expand Down
Binary file modified src/view5d/ByteElement.class
Binary file not shown.
Binary file modified src/view5d/ComplexElement.class
Binary file not shown.
Binary file modified src/view5d/DoubleElement.class
Binary file not shown.
Binary file modified src/view5d/FloatElement.class
Binary file not shown.
Binary file modified src/view5d/ImageCanvas.class
Binary file not shown.
44 changes: 39 additions & 5 deletions src/view5d/ImageCanvas.java
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ public class ImageCanvas extends Canvas implements ImageObserver,MouseListener,M

int imgw = -1;
int imgh = -1;
int defaultTimeElementChoice=1; // Time is the default direction to delete

//int xoff = 0;
//int yoff = 0;
double scale = 1.0; // will be changed in init
Expand Down Expand Up @@ -1127,7 +1129,7 @@ public void mousePressed(MouseEvent e) {
else // just a mouse pressed in the empty image area
{
// e.isAltGraphDown() || // This does not work with matlab
if ( e.isMetaDown() || e.getClickCount()>1 || (e.getModifiers() & Event.ALT_MASK) != 0)
if ( e.isMetaDown() || e.getClickCount()>1 || (e.getModifiersEx() & InputEvent.ALT_DOWN_MASK) != 0)
ImgDragStarted = true;
if (ImgDragStarted) // Only drag the image but do not change coordinates
{
Expand Down Expand Up @@ -1614,7 +1616,20 @@ public boolean checkProceed(String txt) { // calls a user dialog to see if the u
AGenericDialog question= new AGenericDialog("Warning!");
question.addMessage(txt + " modifies the data.\nDo you really want to proceed?");
question.showDialog();
return ! question.wasCanceled();
// System.out.println("Dialog was "+!question.wasCanceled()+"\n");
return (!question.wasCanceled());
}

public int checkChoice(String txt, String [] choices, String default_choice) { // calls a user dialog to see if the user really wants to proceed
int choice=0;
AGenericDialog question= new AGenericDialog("Delete Element or Timepoint");
question.addMessage(txt);
question.addChoice("Delete", choices, default_choice);
question.showDialog();
choice = question.getNextChoiceIndex();
if (question.wasCanceled())
choice = -1;
return choice;
}


Expand All @@ -1627,9 +1642,28 @@ public void ProcessKey(char myChar) {
centerCursor();
return;
case 'D':
if (checkProceed("Delete Element"))
my3ddata.DeleteActElement();
UpdateAllPanels();
if (my3ddata.Elements > 1)
if (my3ddata.Times <= 1)
{if (checkProceed("Delete Element"))
my3ddata.DeleteActElement();}
else
{
String [] choices = {"Element", "Time"};
int choice = checkChoice("Deleting Element/Timepoint modifies the data. Do you really want to proceed?", choices, choices[defaultTimeElementChoice]);
if (choice == 0)
my3ddata.DeleteActElement();
if (choice == 1)
my3ddata.DeleteActTime();
defaultTimeElementChoice=choice; // store the default for the next call
myPanel.CheckScrollBar();
}
else if ((my3ddata.Times > 1))
{if (checkProceed("Delete Timepoint"))
my3ddata.DeleteActTime();
myPanel.CheckScrollBar();
}

UpdateAllPanels();
return;
case 'f': // upcast datatype to float
my3ddata.CloneFloat();
Expand Down
Binary file modified src/view5d/ImageErr.class
Binary file not shown.
Binary file modified src/view5d/ImgPanel.class
Binary file not shown.
Binary file modified src/view5d/IntegerElement.class
Binary file not shown.
Binary file modified src/view5d/MarkerList.class
Binary file not shown.
Binary file modified src/view5d/MarkerLists.class
Binary file not shown.
Binary file modified src/view5d/My3DData$1.class
Binary file not shown.
Binary file modified src/view5d/My3DData$ColorInfo.class
Binary file not shown.
Binary file modified src/view5d/My3DData.class
Binary file not shown.
42 changes: 38 additions & 4 deletions src/view5d/My3DData.java
Original file line number Diff line number Diff line change
Expand Up @@ -2182,10 +2182,12 @@ public void DeleteActElement() // what, if another dublicate exists?
for (int t=0;t<Times;t++) {
DeleteActElement(ElementsAtTime(t));
try {
TimesColorInfo.get(t).removeElement(ActiveElement);
if (TimesColorInfo != null && TimesColorInfo.get(t) != null)
TimesColorInfo.get(t).removeElement(ActiveElement);
}
catch(Exception e)
catch (Exception e)
{
// System.out.println("Exception "+e+"\n");
// ignore this
}
}
Expand All @@ -2202,6 +2204,38 @@ public void DeleteActElement() // what, if another dublicate exists?
InvalidateColor();
}
}

public void DeleteActTime() // what, if another dublicate exists?
{
if (Times > 1) // The last time must not be deleted
{
for (int e=0;e<Elements;e++) {
ElementsAtTime(ActiveTime).removeElementAt(0);
// System.out.println("Time is "+ActiveTime+", Delting Element: "+e+"\n");

try {
if (TimesColorInfo != null && TimesColorInfo.size() > ActiveTime && TimesColorInfo.get(ActiveTime) != null)
TimesColorInfo.get(ActiveTime).removeElement(0);
}
catch(Exception ex)
{
// System.out.println("Exception "+ex+"\n");
// ignore this
}
}
MyTimeProj.removeElementAt(ActiveTime);
MyTimeColorProj.removeElementAt(ActiveTime);
MyTimes.removeElementAt(ActiveTime); // However, all times use the same list of elements.
Times --;

if (ActiveTime >= Times)
ActiveTime = Times-1;
InvalidateSlices();
InvalidateColor();
MyElements = ElementsAtTime(ActiveTime);
sizes[4]=Times;
}
}

public Color GetMarkerColor(int e) {
int Red=0,Green=0,Blue=0;
Expand Down Expand Up @@ -2514,8 +2548,8 @@ else if (dir==1)
}

// vecx = 1.0; vecy = 0.0; vecz = 0.0;
PlanesS[0].addElement(new Integer(ROIXs));PlanesS[1].addElement(new Integer(ROIYs));PlanesS[2].addElement(new Integer(ROIZs));
PlanesD[0].addElement(new Double(vecx));PlanesD[1].addElement(new Double(vecy));PlanesD[2].addElement(new Double(vecz));
PlanesS[0].addElement(Integer.valueOf(ROIXs));PlanesS[1].addElement(Integer.valueOf(ROIYs));PlanesS[2].addElement(Integer.valueOf(ROIZs));
PlanesD[0].addElement(Double.valueOf(vecx));PlanesD[1].addElement(Double.valueOf(vecy));PlanesD[2].addElement(Double.valueOf(vecz));
// Just add the starting points to the Polygon
for (int e=0;e<Elements;e++)
GetBundleAt(e).TakePlaneROIs(PlanesS,PlanesD);
Expand Down
Binary file modified src/view5d/MyMenuProcessor.class
Binary file not shown.
Binary file modified src/view5d/OneElement.class
Binary file not shown.
Binary file modified src/view5d/PixelDisplay.class
Binary file not shown.
Binary file modified src/view5d/PlotInfo.class
Binary file not shown.
Binary file modified src/view5d/PolyROI.class
Binary file not shown.
Binary file modified src/view5d/PositionLabel.class
Binary file not shown.
21 changes: 11 additions & 10 deletions src/view5d/PositionLabel.java
Original file line number Diff line number Diff line change
Expand Up @@ -182,18 +182,19 @@ void Help() {
// javax.swing.JOptionPane.showMessageDialog(applet,
String newtext = "Java 5D image viewer, Version V" + View5D_.serialVersionUID + "." + View5D_.serialSubVersionUID + "." + View5D_.serialSubSubVersionUID + "" +
" by Rainer Heintzmann\nLeibniz-IPHT and Friedrich Schiller University of Jena, Germany (heintzmann@gmail.com)\n\n" +
"NAVIGATION: Right-click for menu and context menus\nUse mouse click for changing slices or cursor keys (arrows) and next/previous page keys.\n" +
"NAVIGATION: Right-click for menu and context menus (individual for panels, colopmap list and text panel)\nUse mouse click for changing slices or cursor keys (arrows) and next/previous page keys.\n" +
"Zoom in and out via the mouse wheel. Press `shift` and use the mouse wheel to change the LUT gamma value. `shift middle mouse click resets gamma to one`\n +" +
"'e' and 'E' movel along the element- (color-) direction. ',' and '.' along time or between multiple images.\n +" +
"'home' positions the cursor in the center.\n" +
"shift-drag images for positon or press space bar before draggin with the mouse, zoom by typing 'A' and 'a' or zoom into a ROI by pressing 'Z'\n\n" +
"VIEW ADJUSTMENT:'<' and '>' for adjusting display magnificaltion perpendicular to the current display\n" +
"'i' for init view, 'c' for change ColorMap, \n" +
"1,2,5,6' for lower and '3,4,7,8' for upper Threshold coarse and fine adjustment, 't' and 'T' for automatic contrast adjustment using one or all elements\n" +
"'e' : toggle elements (if present), 'C' : toggle multicolor display, 'r','g','b' : select element for respective display\n" +
"'R','G','B' : clear respective channel, 'p','P': Toggle Projections (MIP, Avg)\n\n"+
"ROIs: Shift and mouse-drag for square ROIs, 'Ctrl-s' toggles ROI modes mouse-drag for multiple line ROIs\n\n"+
"'home'/'pos1' positions the cursor at the center for this panel.\n" +
"shift-drag images for positon or press space bar before draggin with the mouse, zoom by typing 'A' and 'a' or zoom-fit a ROI by pressing 'Z'\n\n" +
"VIEW ADJUSTMENT:'<' and '>' to adjusting display magnification (if aspect is not locked) perpendicular to the current display (like the mouse wheel)\n" +
"'i' to initialize view, 'c' to change ColorMap, \n" +
"1,2,5,6' for lower and '3,4,7,8' for upper Threshold coarse and fine adjustment, 't' and 'T' for automatic contrast adjustment for one or all elements repectively\n" +
"'e': toggle elements (if present), 'C': toggle multicolor display, 'r','g','b': select element for respective display\n" +
"'G': set element to gray colormap, 'R': glow red colormap, 'B': rainbow colormap, 'p','P': Toggle Projections (MIP, Avg)\n\n"+
"ROIs: 'shift' and mouse-drag for square ROIs, 'Ctrl-s' toggles ROI modes mouse-drag for multiple line ROIs\n\n"+
"See the context menus (right click) in the main and element displays for more commands with the respective keys shown in []\n" +
"For further Documentation see http://www.nanoimaging.de/View5D/";
"For further Documentation and commands see http://www.nanoimaging.de/View5D/";
if (false) {
MyText.setText(newtext);
MyText.setCaretPosition(0);
Expand Down
Binary file modified src/view5d/ROI.class
Binary file not shown.
Binary file modified src/view5d/RectROI.class
Binary file not shown.
Binary file modified src/view5d/ShortElement.class
Binary file not shown.
Binary file modified src/view5d/TaggedCheck.class
Binary file not shown.
Binary file modified src/view5d/TaggedChoice.class
Binary file not shown.
Binary file modified src/view5d/TaggedComponent.class
Binary file not shown.
Binary file modified src/view5d/TaggedDouble.class
Binary file not shown.
Binary file modified src/view5d/TaggedText.class
Binary file not shown.
Binary file modified src/view5d/UnsignedShortElement.class
Binary file not shown.
Binary file modified src/view5d/View5D.class
Binary file not shown.
Binary file modified src/view5d/View5D_.class
Binary file not shown.
2 changes: 1 addition & 1 deletion src/view5d/View5D_.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
public class View5D_ extends PlugInFrame implements PlugIn, WindowListener {
public static final long serialVersionUID = 2;
public static final long serialSubVersionUID = 3;
public static final long serialSubSubVersionUID = 7;
public static final long serialSubSubVersionUID = 8;
// Panel panel;
int previousId;
ImagePlus imp;
Expand Down

0 comments on commit 7b7e285

Please sign in to comment.