Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add MaskedSource #607

Draft
wants to merge 30 commits into
base: develop
Choose a base branch
from
Draft

Add MaskedSource #607

wants to merge 30 commits into from

Conversation

tischi
Copy link
Contributor

@tischi tischi commented Feb 19, 2022

Made great progress in enabling interactive cropping in MoBIE, even when the viewer is not aligned with the physical axes 🥳

image

Also seems I found a much better way to implement the crop as a MaskedSource (thanks to great help in https://gitter.im/imglib/imglib2)

  • implement the center feature, which is not yet done in the MaskedSource
  • check whether we could entirely replace the current CropSourceTransformer and make it it use the new MaskedSource, which seems to be much more performant and also easier to understand.
  • implement Save current view: add new view to UI #606

@martinschorb Could you please point me to a simple example where we use the crop of a source?

@tischi tischi self-assigned this Feb 19, 2022
@@ -64,6 +62,8 @@ public void run()
final SourceAndConverter cropSource = cropSource( maskInterval, maskTransform, sourceAndConverter );

// TODO: can we create a view for this?
final MoBIE moBIE = MoBIE.getInstance( bdvHandle );
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@K-Meech Do you have experience here and could help? The point is to somehow create and register a new view for the cropSource (actually this is a MaskedSource, need to change names later, maybe).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you would need to create the relevant SourceTransformer by getting the min/max of the crop etc from the Source. Then somehow add it to the the currentSourceTransformers in the ViewManager. Then, when you save the current settings as a view, it will be made into a view when this function is called: https://github.com/mobie/mobie-viewer-fiji/blob/develop/src/main/java/org/embl/mobie/viewer/view/ViewManager.java#L208

@tischi
Copy link
Contributor Author

tischi commented Feb 19, 2022

@K-Meech
If you have some time it would be cool if you could have a look at this PR.
I tagged you where I think you may be the expert 😃

@tischi tischi requested a review from K-Meech February 19, 2022 21:38
@tischi
Copy link
Contributor Author

tischi commented Feb 20, 2022

@K-Meech I think a method viewFromSourceAndConverter would be good to have, what do you think?

@tischi
Copy link
Contributor Author

tischi commented Feb 20, 2022

I created a PR for working on creating a view from a sac.

@K-Meech
Copy link
Contributor

K-Meech commented Feb 21, 2022

For making a view form a sac, this is kindof what is being done by here and here. At the moment, this is triggered here and below, when new ImageSourceDisplay, SegmentationSourceDisplay or AnnotatedIntervalDisplay are made. Some things are taken from the sac, and some from the display - so I'm not sure if you could get all the view settings directly from the sac?

@tischi
Copy link
Contributor Author

tischi commented Feb 21, 2022

I am also not sure...

I think we'll simply have to give it a try in this PR

Do you want to give it a go or shall I?

@K-Meech
Copy link
Contributor

K-Meech commented Feb 21, 2022

Could you give it a go? I'm fixing up some project creator stuff at the moment.

@tischi
Copy link
Contributor Author

tischi commented Feb 21, 2022

ok!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants