-
Notifications
You must be signed in to change notification settings - Fork 6
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
Neurosift shows images rotated #179
Comments
Thanks @h-mayorquin for the very helpful example for calibration. I have fixed this. @CodyCBakerPhD @bendichter This change is going to affect the Neurosift orientation of all Image neurodata objects. I know there was discussion about having a rotate button in NS, but in this case (where it's an "Image") I feel like there should be one true orientation, so if it works with @h-mayorquin 's example, then we should be good? I could be wrong about this though, that's why I'm tagging you. BTW, a slightly updated script that adds a bit more structure to calibrate the vertical flip import numpy as np
import matplotlib.pyplot as plt
from pynwb.testing.mock.file import mock_NWBFile
from pynwb.image import GrayscaleImage, Images
from pynwb import NWBHDF5IO
img = np.zeros((1000, 1500))
img[:, 200:400] = 1
img[0:50][:, 200:400] = 0.5
plt.imshow(img, cmap="gray")
# plt.imshow(np.rot90(img, k=1), cmap="gray")
nwbfile = mock_NWBFile()
image = GrayscaleImage(name="test_image", data=img)
images_container = Images(
name="stimuli",
images=[image],
description=f"test image",
)
nwbfile.add_stimulus(images_container)
with NWBHDF5IO("test.nwb", "w") as io:
io.write(nwbfile)
with NWBHDF5IO("test.nwb", "r") as io:
nwbfile_read = io.read()
image_data = nwbfile_read.stimulus["stimuli"].images["test_image"].data
plt.imshow(image_data, cmap="gray")
plt.show() Then compare that plot with neurosift view-nwb test.nwb |
But in neurosift:
Code to reproduce
The text was updated successfully, but these errors were encountered: