grimbough / rhdf5

Package providing an interface between HDF5 and R
http://bioconductor.org/packages/rhdf5
61 stars 22 forks source link

Reading ijtiff images #64

Open elodiegermani opened 4 years ago

elodiegermani commented 4 years ago

Dear developper, we try to display our image with R (image in tiff format read with the ijtiff package 204820486 channels*1 slices). The display in ijtiff is quite long so we try your package :

h5createDataset("myhdf5file.h5", "test/fullImg", dims=c(2048,2048,6,1), storage.mode = "double", level=7) h5write(fullImg, file="myhdf5file.h5", name="test/fullImg") But first it took a lot of time to write the image and then the time to display it was also very long. Have you ever try to use your package with this kind of images ? Could you advice us on the good option to use ?

Thanks very much

grimbough commented 4 years ago

Hi, thanks for the interest in the package. I've not tried writing a tiff image specifically, but a 4D array with the dimensions you've given isn't particularly big and I don't think it should take very long.

Can you use system.time() to report back how long it's taking to write the data? It would also be helpful if you could share an example image so I can test will the real data.

elodiegermani commented 4 years ago

Thanks for your answer. To write the image in a dataset created with your package it took 6.6 seconds...

h5createDataset("myhdf5file.h5", "foo/test", dim(fullImg), storage.mode = "double") t1 <- Sys.time() h5write(fullImg, "myhdf5file.h5", name="foo/test") t2 <- Sys.time() Tdiff <- difftime(t2,t1) Tdiff Time difference of 6.659484 secs

I can't send you the image by github it don't support that file type and i think the image is too big... It is a 300 Mo image with 12 slices but with R, to minimize the charging time we read slices one by one with the ijtiff package.