-
Notifications
You must be signed in to change notification settings - Fork 84
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
Roi #703
Roi #703
Conversation
x0, x1 = idxs['x'] | ||
y0, y1 = idxs['y'] | ||
z0, z1 = idxs['z'] | ||
return np.index_exp[z0:z1, y0:y1, x0:x1] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
very cool!!
loving it! |
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
@bnmajor awesome job!
A few requests inline.
This is a good dataset, but another to consider is:
https://data.kitware.com/#item/63476e0911dab81428208e27
for more scales / variety. |
1 similar comment
@bnmajor awesome job!
A few requests inline.
This is a good dataset, but another to consider is:
https://data.kitware.com/#item/63476e0911dab81428208e27
for more scales / variety. |
@@ -0,0 +1,350 @@ | |||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This gif is wicked cool to have embedded in the notebook!! How did you do that? :-D
Reply via ReviewNB
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's just an html image tag in a markdown cell! Updated to use the full URL instead of the relative path though so it may appear broken in the review notebook now until these changes are merged in.
@@ -0,0 +1,350 @@ | |||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line #1. loaded_scale
Let's make a note, provide a reminder on how the scales, are defined, i.e. "Zero is the highest resolution scale."
Reply via ReviewNB
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good, updated 👍
@@ -0,0 +1,350 @@ | |||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line #1. roi_region
Let's make a note / provide a reminder that these are in physical, world coordinates.
Reply via ReviewNB
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it!
@@ -0,0 +1,350 @@ | |||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line #3. # Request the highest level explicitly in case that is not what is loaded.
To make the connection clearer, let's use loaded_scale
here.
Reply via ReviewNB
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good!
@@ -0,0 +1,350 @@ | |||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line #1. roi_slice
Let's add another cell for illustration that calls viewer.get_roi_slice()
(no argument) that demonstrates we get the same result since that is the current scale.
Reply via ReviewNB
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
Add support for being able to programmatically retrieve information about the current region of interest.
Awesome! |
@@ -0,0 +1,365 @@ | |||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line #2. print(roi_slices, default_roi_slices)
We could make these two print statements so they are easier to compare.
Reply via ReviewNB
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it!
@thewtex Two last items: |
@bnmajor what is your |
Checking this branch out locally, I could not reproduce with ngff-Zarr 0.6.0. |
I was on EDIT: Actually, still seeing it with |
I seem to recall an older version of itk-vtk-viewer causing this behavior -- is it possible that an old version is used locally? |
I tried again with a fresh conda environment and repository checkout, the spacing was correct and consistent across scales. |
Oh, I was just looking and |
This is extracting only the array and discarding the metadata. |
with: # Create a new viewer using only the data in the ROI determined above
loaded_image = multiscales.images[loaded_scale]
roi_data = loaded_image.data[roi_slices]
from ngff_zarr import to_ngff_image
roi_image = to_ngff_image(roi_data, dims=loaded_image.dims, scale=loaded_image.scale, translation={'x': roi_region[0][0], 'y': roi_region[0][1], 'z': roi_region[0][2]})
from ngff_zarr import to_ngff_image
? |
If we just grab the array we'll drop the metadata and get a skewed result.
Updates have been pushed, thank you |
And multiscale-spatial-image.
Sorry, I was not too clear -- I will push a patch with a minor tweak. |
I see, sorry about my misunderstanding! Thanks for the fix! |
@thewtex This is good to go from my end if everything is looking good for you as well |
Depends on Kitware/itk-vtk-viewer#724 and #702