How to make deep copy of a bio-formats reader in Matlab
Posted: Wed Aug 15, 2018 2:46 pm
Hello,
I have the following example, where I would like to make a copy of a bio-format reader. Unfortunately, Matlab copies only the handle and does not allow me to make a deep copy of the reader.
Is there a way to duplicate the reader somehow, so that the code works?
Thanks!
I have the following example, where I would like to make a copy of a bio-format reader. Unfortunately, Matlab copies only the handle and does not allow me to make a deep copy of the reader.
Is there a way to duplicate the reader somehow, so that the code works?
- Code: Select all
reader1 = bfGetReader('myfile.ext'); % get a reader
reader2 = reader1; % duplicate the reader;
% the 'copy' function does not work on
% loci.formats.ChannelSeparator class
plane1 = bfGetPlane(reader1, 1); % get a plane
plane2 = bfGetPlane(reader2, 1); % get a plane
reader1.close(); % close the first reader
plane2 = bfGetPlane(reader2, 1); % does not work
Thanks!