We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
import numpy as np import matplotlib.pyplot as plt # Initialize an RGBA image with zeros img = np.zeros((1000, 1000, 3)) # Set the desired region to white (1, 1, 1, 1) in RGBA img[:, 200:400, :] = [1, 1, 1] from pynwb.testing.mock.file import mock_NWBFile from pynwb.image import RGBImage, Images nwbfile = mock_NWBFile() image = RGBImage(name='test_image', data=img) images_container = Images( name="stimuli", images=[image], description=f"test image", ) nwbfile.add_stimulus(images_container) from pynwb import NWBHDF5IO 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)
Error in neurosfit
The text was updated successfully, but these errors were encountered:
@h-mayorquin I got this working... but I assume values are integer between 0 and 255, so your particular example won't work.
Here's are a couple examples from DANDI
https://neurosift.app/?p=/nwb&url=https://api.dandiarchive.org/api/assets/acd6a646-f8c7-405e-9815-78fd6b6e442d/download/&dandisetId=000673&dandisetVersion=0.240524.1758&tab=neurodata-item:/stimulus/templates/StimulusTemplates|Images
https://neurosift.app/?p=/nwb&url=https://api.dandiarchive.org/api/assets/ecfb1b42-96c4-4552-aeee-0f12c6da06d2/download/&dandisetId=000469&dandisetVersion=0.240123.1806&tab=neurodata-item:/stimulus/templates/StimulusTemplates|Images
Sorry, something went wrong.
Because of the floats.
As discussed on #179 (comment) this seems to be working on my images so probably something wrong with my example.
Thanks.
No branches or pull requests
Error in neurosfit
The text was updated successfully, but these errors were encountered: