How to read 3D dataset in downsample manner


#1

Hi,
I have a hdf5 file with a 3D grey scale image DataSet. The DataSet dimension is x * y * z.
To read the 3D Dataset into matlab:
readStart = [1,1,1]; % matlab use 1-based index
SizeToRead = [x,y,z];
aData = h5read(‘D:\QMDownload\sample.h5’,[’/Root/Data’],readStart,SizeToRead);

Because the dataset is huge, I want to reading the dataset in an downsampled manner:
x: downsample as 1 : 50 : end (start from first element, read in 1,51,101,151,… to the end as possible.
y: downsample as 1 : 50 : end (start from first element, read in 1,51,101,151,…to the end as possible.
z: no downsample.

Is there a command to downsample the dataset, either making new file or just read to the workspace?
Thanks


#2

Got it
data = h5read(filename,datasetname,start,count,stride)