Skip to content

Commit

Permalink
Address #1169
Browse files Browse the repository at this point in the history
  • Loading branch information
tischi committed Jul 4, 2024
1 parent 168ddb6 commit ccd73bb
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
import org.embl.mobie.lib.image.Image;
import org.embl.mobie.lib.image.RegionAnnotationImage;
import org.embl.mobie.lib.serialize.View;
import org.embl.mobie.lib.serialize.display.Display;
import org.embl.mobie.lib.serialize.transformation.AffineTransformation;
import org.embl.mobie.lib.transform.TransformationOutput;
import org.embl.mobie.lib.view.ViewManager;
Expand Down Expand Up @@ -130,7 +131,18 @@ protected void applyTransform( AffineTransform3D affineTransform3D )

createSaveAndViewAffineTransformedImages( movingImages, affineTransform3D, suffix );

// Remove the moving image displays
// because we are now showing the transformed once
List< String > movingImageNames = selectedImages.getNames();
ViewManager viewManager = MoBIE.getInstance().getViewManager();
List< Display > displays = viewManager.getCurrentSourceDisplays();
List< Display > displaysToRemove = displays.stream()
.filter( display -> display.getSources().size() == 1 )
.filter( display -> display.getSources().stream().anyMatch( movingImageNames::contains ) )
.collect( Collectors.toList() );

for ( Display display : displaysToRemove )
viewManager.removeDisplay( display, false );

// FIXME close the Command UI, HOW?
// Maybe we use the hack that finds the awt Window based on its name?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,20 @@
*/
package org.embl.mobie.command.context;

import org.embl.mobie.MoBIE;
import org.embl.mobie.command.CommandConstants;
import org.embl.mobie.command.MoBIEManualTransformationEditor;
import org.embl.mobie.lib.serialize.display.Display;
import org.embl.mobie.lib.view.ViewManager;
import org.scijava.ItemVisibility;
import org.scijava.plugin.Parameter;
import org.scijava.plugin.Plugin;
import org.scijava.widget.Button;
import sc.fiji.bdvpg.scijava.command.BdvPlaygroundActionCommand;

import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;

@Plugin(type = BdvPlaygroundActionCommand.class, attrs = {}, menuPath = CommandConstants.CONTEXT_MENU_ITEMS_ROOT + "Transform>Registration - Manual")
public class ManualTransformationCommand extends AbstractTransformationCommand
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -198,8 +198,7 @@
"invert": false,
"name": "blobs-transformed",
"opacity": 1.0,
"visible": true,
"blendingMode": "sum"
"visible": true
}
}
],
Expand All @@ -210,11 +209,11 @@
1.0000000000000002,
0.0,
0.0,
-96.4864864864865,
-113.45114345114347,
0.0,
1.0000000000000002,
0.0,
-32.86902286902287,
-36.049896049896056,
0.0,
0.0,
1.0000000000000002,
Expand Down

0 comments on commit ccd73bb

Please sign in to comment.