Skip to content

Commit

Permalink
v.0.3.7
Browse files Browse the repository at this point in the history
  • Loading branch information
ekatrukha committed Jan 2, 2024
1 parent bf62ff2 commit de20bd8
Show file tree
Hide file tree
Showing 8 changed files with 123 additions and 129 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@
<dependency>
<groupId>fiji.experimental</groupId>
<artifactId>bvv-playground</artifactId>
<version>0.1.2</version>
<version>0.1.3</version>
</dependency>

<!-- BIOFORMATS -->
Expand Down
42 changes: 21 additions & 21 deletions src/main/java/bigtrace/BigTrace.java
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ public class BigTrace < T extends RealType< T > > implements PlugIn, WindowListe
public Box3D visBox = null;

/** helper box to visualize one-click tracing things **/
public Box3D cropBox = null;
public Box3D clipBox = null;

/** object storing main data/variables **/
public BigTraceData<T> btdata;
Expand Down Expand Up @@ -242,7 +242,7 @@ public void initOriginAndBox(double axis_length)
nDimBox[1][i]=(btdata.nDimIni[1][i]-1.0f);
}
volumeBox = new Box3D(nDimBox,0.5f,0.0f,Color.LIGHT_GRAY,Color.LIGHT_GRAY, 0);
cropBox = new Box3D(nDimBox,0.5f,0.0f,Color.LIGHT_GRAY,Color.LIGHT_GRAY, 0);
clipBox = new Box3D(nDimBox,0.5f,0.0f,Color.LIGHT_GRAY,Color.LIGHT_GRAY, 0);
}
public void initSourcesCanvas(double origin_axis_length)
{
Expand Down Expand Up @@ -305,7 +305,7 @@ public void actionAddPoint()
RealPoint target = new RealPoint(3);
if(!bTraceMode)
{
if(findPointLocationFromClick(btdata.getDataCurrentSourceCropped(), btdata.nHalfClickSizeWindow,target))
if(findPointLocationFromClick(btdata.getDataCurrentSourceClipped(), btdata.nHalfClickSizeWindow,target))
{

// System.out.println(target.getDoublePosition(0));
Expand Down Expand Up @@ -560,14 +560,14 @@ public void actionZoomIn()
RealPoint target = new RealPoint(3);
if(!bTraceMode)
{
if(findPointLocationFromClick(btdata.getDataCurrentSourceCropped(), btdata.nHalfClickSizeWindow,target))
if(findPointLocationFromClick(btdata.getDataCurrentSourceClipped(), btdata.nHalfClickSizeWindow,target))
{

final FinalInterval zoomInterval = getTraceBoxCentered(getTraceInterval(!btdata.bZoomCrop),btdata.nZoomBoxSize, target);
final FinalInterval zoomInterval = getTraceBoxCentered(getTraceInterval(!btdata.bZoomClip),btdata.nZoomBoxSize, target);

if(btdata.bZoomCrop)
if(btdata.bZoomClip)
{
btpanel.cropPanel.setBoundingBox(zoomInterval);
btpanel.clipPanel.setBoundingBox(zoomInterval);
}

//animate
Expand Down Expand Up @@ -599,7 +599,7 @@ public void actionZoomOut()
{
if(!bTraceMode)
{
viewer.setTransformAnimator(getCenteredViewAnim(btdata.getDataCurrentSourceCropped(),1.0));
viewer.setTransformAnimator(getCenteredViewAnim(btdata.getDataCurrentSourceClipped(),1.0));
}
else
{
Expand All @@ -609,15 +609,15 @@ public void actionZoomOut()
}
}

public void actionResetCrop()
public void actionResetClip()
{
Component c = KeyboardFocusManager.getCurrentKeyboardFocusManager().getFocusOwner();
//solution for now, to not interfere with typing
if(!bInputLock && !(c instanceof JTextField))
{
if(!bTraceMode)
{
btpanel.cropPanel.setBoundingBox(btdata.nDimIni);
btpanel.clipPanel.setBoundingBox(btdata.nDimIni);
}
}
}
Expand Down Expand Up @@ -647,7 +647,7 @@ public void installActions(final Actions actions)
actions.runnableAction(() -> actionSemiTraceStraightLine(), "straight line semitrace", "R" );
actions.runnableAction(() -> actionZoomIn(), "zoom in to click", "D" );
actions.runnableAction(() -> actionZoomOut(), "center view (zoom out)", "C" );
actions.runnableAction(() -> actionResetCrop(), "reset crop", "X" );
actions.runnableAction(() -> actionResetClip(), "reset clipping", "X" );
actions.runnableAction(() -> actionToggleRender(), "toggle render mode", "O" );
actions.runnableAction(() -> actionSelectRoi(), "select ROI", "E" );

Expand Down Expand Up @@ -703,7 +703,7 @@ public void calcShowTraceBox(final LineTrace3D trace, final boolean bRefine)

IntervalView<?> traceIV;

traceIV = getTraceInterval(btdata.bTraceOnlyCrop);
traceIV = getTraceInterval(btdata.bTraceOnlyClipped);

if(trace.numVertices()==1)
{
Expand Down Expand Up @@ -749,7 +749,7 @@ public void runOneClickTrace(final RealPoint pclick)

IntervalView<?> traceIV;

traceIV = getTraceInterval(btdata.bTraceOnlyCrop);
traceIV = getTraceInterval(btdata.bTraceOnlyClipped);
// System.out.println(pclick.getDoublePosition(0));
// System.out.println(pclick.getDoublePosition(1));
// System.out.println(pclick.getDoublePosition(2));
Expand All @@ -764,13 +764,13 @@ public void runOneClickTrace(final RealPoint pclick)

}

/** returns current Interval for the tracing. If bCroppedInterval is true,
* returns cropped area, otherwise returns full original volume. **/
IntervalView<T> getTraceInterval(boolean bCroppedInterval)
/** returns current Interval for the tracing. If bClippedInterval is true,
* returns clipped volume, otherwise returns full original volume. **/
IntervalView<T> getTraceInterval(boolean bClippedInterval)
{
if(bCroppedInterval)
if(bClippedInterval)
{
return btdata.getDataSourceCropped(btdata.nChAnalysis, btdata.nCurrTimepoint);
return btdata.getDataSourceClipped(btdata.nChAnalysis, btdata.nCurrTimepoint);
}
else
{
Expand Down Expand Up @@ -1086,9 +1086,9 @@ public void renderScene(final GL3 gl, final RenderData data)
volumeBox.draw(gl, pvm, camview, screen_size);
}
//render a box around the volume
if (btdata.bCropBox)
if (btdata.bClipBox)
{
cropBox.draw(gl, pvm, camview, screen_size);
clipBox.draw(gl, pvm, camview, screen_size);
}

//one click tracing box
Expand Down Expand Up @@ -1239,7 +1239,7 @@ public void initBVVSourcesSpimData()

for(int i=0;i<bvv_sources.size();i++)
{
bvv_sources.get(i).setCropTransform(afDataTransform);
bvv_sources.get(i).setClipTransform(afDataTransform);

}
//check the alignment
Expand Down
Loading

0 comments on commit de20bd8

Please sign in to comment.