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

support preview of a pv image from a downsampled cube (backend) #795

Closed
kswang1029 opened this issue Apr 13, 2021 · 3 comments · Fixed by #1253
Closed

support preview of a pv image from a downsampled cube (backend) #795

kswang1029 opened this issue Apr 13, 2021 · 3 comments · Fixed by #1253
Assignees
Labels
enhancement New feature or request

Comments

@kswang1029
Copy link
Contributor

kswang1029 commented Apr 13, 2021

As part of the PV generator feature, the backend needs to support streaming pv images when the pv cut is updating on the GUI. This is only possible if the backend generates a downsampled cube in memory so that image slicing can be much more efficient than from HDD/SSD.

More detailed doc will be provided soon.

@kswang1029
Copy link
Contributor Author

kswang1029 commented May 7, 2021

x	y	z	reduction_factor
========================================
1	1	1	1
1	1	2	2
2	2	1	4
2	2	2	8
2	2	4	16
4	4	2	32
4	4	4	64
4	4	8	128
8	8	4	256
8	8	8	512

Here is an initial idea of how we can (block averaging in xy, rebin or decimation in z) downsample the cube for pv preview. We could consider two approaches: 1) try to compute the final file size of the downsampled cube according to the sequence of the list before it exceeds the memory budget then we adopt the set of the downsampling factors. 2) we offer all possible options (xy: 1, 2, 4, 8; z:1, 2, 4, 8) as dropdown menus for users to select.

The 1) appears smarter (less user configuration) but it might be generating an improper downsampled cube for preview due the complexity in source structures in spatial (compact vs extended) and spectral (narrow line vs broad line) domains. With 2) users can adjust how the cube should be downsampled based on their knowledge about the source feature.

At the moment I prefer having option 2) as it has flexibilities to handle various source features despite we need additional UI elements.

@veggiesaurus
Copy link
Collaborator

surely some situations would call for e.g. 2x2x8 or 1x1x8? If you have situations where you have many channels and a small spatial region.

I suggest we provide users with options to choose from that result in the required downsampled size. For example if we need to achieve a reduction factor of 100, we could have a single dropdown that has the following:

  • 1 x 1 x 128
  • 2 x 2 x 32
  • 4 x 4 x 8
  • 8 x 8 x 2
  • 16 x 16 x 1

And possibly we automatically select the one which results in the largest minimum axis length. For example,if you select a very small region and a large number of channels, it would favour spectral downsampling. if you select a large region and few channels, it would favour spatial downsampling

@kswang1029 kswang1029 added the enhancement New feature or request label Jun 8, 2021
@kswang1029 kswang1029 added this to the v3.0b-2 milestone Jul 12, 2021
@veggiesaurus
Copy link
Collaborator

@kswang1029 I don't think we can realistically do this in beta-2

@veggiesaurus veggiesaurus removed this from the v3.0b-2 milestone Aug 25, 2021
@kswang1029 kswang1029 changed the title support preview of a pv image from a downsampled cube support preview of a pv image from a downsampled cube (backend) Aug 25, 2022
@pford pford mentioned this issue Apr 13, 2023
5 tasks
@pford pford linked a pull request Apr 27, 2023 that will close this issue
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants