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

crop in transformed coordinates #168

Open
martinschorb opened this issue May 10, 2021 · 9 comments
Open

crop in transformed coordinates #168

martinschorb opened this issue May 10, 2021 · 9 comments

Comments

@martinschorb
Copy link

Hi,

I like to crop a dataset in an arbitrary orientation.

However, the bounding box is only shown in the original volume coordinates. Can I provide a transformed source and crop it in the viewer's frame?

@tischi
Copy link
Collaborator

tischi commented May 10, 2021

Yes, you can using: [Process > Transform] (enter an affine transform) and then afterwards do [Process > Crop...]. Would that work for you?

@tischi
Copy link
Collaborator

tischi commented May 10, 2021

I can also try to make the Manual Transform [T] work (which currently does not); would that help?

@martinschorb
Copy link
Author

My actual intention was to use the cropping to define sources for a gallery view of subvolumes. mobie/mobie.github.io#32
I am trying to find out how the cropping and transformation could be best stored in a MoBIE2 compatible way.

@martinschorb
Copy link
Author

so it seems there is no way of storing a crop only in metadata. Even when I load a BDV/XML dataset into BDP2 and crop it saving requires to write a new data container. Would it be possible to do this entirely at the metadata level? So that instead of defining transformations only, I could also define the crop bounding box? Ideally in the same logic of a transformation... So one could even do:

transformation -> crop (arbitrary BBox orientation) -> transform (display)

@tischi
Copy link
Collaborator

tischi commented May 10, 2021

Conceptually possible.

@NicoKiaru do we have a crop( SourceAndConverter sac, Interval interval ) in the playground?

@constantinpape @K-Meech do you feel having a spec for a crop of an image in MoBIE would be something generally useful (to me it feels that could be something useful in order show sub-volumes of big image data sets)

@martinschorb regarding "arbitrary BBox orientation" I think the easiest would be to first transform the source into a space where you can then crop along the cartesian axes (and the crop would be given in this coordinate system).

@martinschorb
Copy link
Author

I think the easiest would be to first transform the source into a space where you can then crop along the cartesian axes (and the crop would be given in this coordinate system).

Yes, that's precisely what I thought of and what I would need in that gallery use case.

@constantinpape
Copy link

@constantinpape @K-Meech do you feel having a spec for a crop of an image in MoBIE would be something generally useful (to me it feels that could be something useful in order show sub-volumes of big image data sets)

Yes, I agree that could be useful, as already discussed in mobie/mobie.github.io#32.
I have made an issue in the mobie repo on this mobie/mobie.github.io#44.

@tischi
Copy link
Collaborator

tischi commented May 10, 2021

@martinschorb Would you already have a convenient workflow for how to determine the transformation and crop? Or should we add something to BDV-Playground or BigDataProcessor2?

@martinschorb
Copy link
Author

Would you already have a convenient workflow for how to determine the transformation and crop

Yes, that is all ready to go. The scenario is:

  • volume that includes a centriole
  • I transform such that the major axis of the centriole is in the center of the FOV and parallel to x.
  • now I want to only show a gallery of many centrioles in that orientation
  • this means I need to crop the individual sources to the subvolume around the centrioles
  • so the BBox would be center +- xyz in physical coordinates after applying this targeting transformation

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

No branches or pull requests

3 participants