Open martinschorb opened 4 years ago
Or could you add support for 2D data? BDV can somehow deal with it. Should I send you a 2D hdf5 file that is compatible with the BDV universe?
Yes, that would be the best option! If there is a way to properly support 2d in BDV without adding the artificial z-axis I can support it.
minimal example ;-)
However, I see that this one still comes "3D".
cells (6942379, 4)
16-bit integer, 1 x 256 x 256
Number of attributes = 0
The output that I get from IMOD (from reconstructing/blending TEM tiled montages) has an image:
image (6776, 6)
16-bit unsigned integer, 9696 x 9744
Number of attributes = 0
Would this be a problem? Also, how much performance gain is it to retrieve the 0th layer from a hdf5 file instead of a np-Array? Does the data still have to be read in and fed through Python for the sub-resolutions?
However, I see that this one still comes "3D".
Yes, this is still 3d, so I think whichever program writes to bdv is also adding the z axis.
Would this be a problem? Also, how much performance gain is it to retrieve the 0th layer from a hdf5 file instead of a np-Array?
No I don't think this is a problem. I can just add something to convert_to_bdv
so that it also adds the z-axis. I don't think this will make a big difference in performance.
Does the data still have to be read in and fed through Python for the sub-resolutions?
I am not quite sure what you mean by this. I also create all the downsampling in python, but it works with this kind of data already.
We discussed this and this is not really relevant for Martin's current use case.
BUT I think it would actually be nice to properly support 2d data, because this is a very important use-case. Unfortunately, there is no 'native' support for 2d in the BigDataViewer File Format yet, so the trick one has to do is to add a singleton z-axis.
I think that this should be done internally in pybdv, so that users can just pass 2d data, either to make_bdv
or convert_to_bdv
and then pybdv takes care of inserting the correct singleton axis were it's relevant. This has the advantage that it is easier to do this in a consistent manner AND switching to a proper 2d format if it is ever supported natively by bdv-hdf5, this just becomes an implementation detail.
@martinschorb, let me know what you think.
perfect. I will then simply comment out that part of the code (adding singleton axis 0) in my script...
as I did for the type conversions to unsigned int ;-)
perfect. I will then simply comment out that part of the code (adding singleton axis 0) in my script...
Ok, great. I will let you know once I had time too implement it :).
It's not in yet, correct? Just to be sure I run the newest version...
It's not in yet, correct? Just to be sure I run the newest version...
Yes, it's not in yet.
Hi,
currently pybdv only supports 3D input data. This is fine as long as I use make_bdv. I will just fake the third dimension by using
np.expand_dims(data.copy(),axis=0)
.However, I like to now use pybdv's
convert_to_bdv
to convert an existing hdf5 file and this is written as 2D. Could you apply something similar within the hdf5 file as well? Or could you add support for 2D data? BDV can somehow deal with it. Should I send you a 2D hdf5 file that is compatible with the BDV universe?Thanks...