Skip to content

Commit

Permalink
Added support for TIFF files
Browse files Browse the repository at this point in the history
  • Loading branch information
jwtay1 committed Apr 13, 2020
1 parent e1191c9 commit 7e5e841
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 17 deletions.
21 changes: 9 additions & 12 deletions build/Bioformats Image Toolbox.prj
@@ -1,14 +1,14 @@
<deployment-project plugin="plugin.toolbox" plugin-version="1.0">
<configuration build-checksum="1629181179" file="D:\Jian\Documents\Projects\coreCode\bioformats-image\code\build\Bioformats Image Toolbox.prj" location="D:\Jian\Documents\Projects\coreCode\bioformats-image\code\build" name="Bioformats Image Toolbox" target="target.toolbox" target-name="Package Toolbox">
<param.appname>Bioformats Image Toolbox (v1.1.0)</param.appname>
<configuration build-checksum="1629181179" file="D:\Projects\Bioformats Image Toolbox\code\build\Bioformats Image Toolbox.prj" location="D:\Projects\Bioformats Image Toolbox\code\build" name="Bioformats Image Toolbox" target="target.toolbox" target-name="Package Toolbox">
<param.appname>Bioformats Image Toolbox (v1.2.0)</param.appname>
<param.authnamewatermark>Jian Wei Tay</param.authnamewatermark>
<param.email>jian.tay@colorado.edu</param.email>
<param.company>University of Colorado Boulder</param.company>
<param.summary>MATLAB re-implementation of the Bioformats Image Toolbox by the OME group</param.summary>
<param.description />
<param.screenshot>${PROJECT_ROOT}\BioformatsImageIcon.png</param.screenshot>
<param.version>1.1.0</param.version>
<param.output>${PROJECT_ROOT}\Bioformats Image Toolbox (v1.1.0).mltbx</param.output>
<param.version>1.2.0</param.version>
<param.output>${PROJECT_ROOT}\Bioformats Image Toolbox (v1.2.0).mltbx</param.output>
<param.products.name />
<param.products.id />
<param.products.version />
Expand All @@ -22,10 +22,7 @@
<param.registered.apps />
<param.docs />
<param.getting.started.guide />
<param.matlabpath.excludes>
<item>/BioformatsImage/bfmatlab</item>
<item>/docs</item>
</param.matlabpath.excludes>
<param.matlabpath.excludes />
<param.javaclasspath.excludes>
<item>/BioformatsImage/bfmatlab/bioformats_package.jar</item>
</param.javaclasspath.excludes>
Expand Down Expand Up @@ -64,6 +61,7 @@
<param.registered.apps />
<param.docs />
<param.getting.started.guide />
<param.matlabpath.excludes />
<param.exported.on.package />
<param.required.addons />
<param.matlab.project.id />
Expand All @@ -83,17 +81,16 @@
<param.additional.sw.linux.url />
</unset>
<fileset.rootdir>
<file>D:\Jian\Documents\Projects\coreCode\bioformats-image\code\tbx</file>
<file>D:\Projects\Bioformats Image Toolbox\code\tbx</file>
</fileset.rootdir>
<fileset.rootfiles>
<file>D:\Jian\Documents\Projects\coreCode\bioformats-image\code\tbx\BioformatsImage</file>
<file>D:\Jian\Documents\Projects\coreCode\bioformats-image\code\tbx\docs</file>
<file>D:\Projects\Bioformats Image Toolbox\code\tbx\BioformatsImage</file>
</fileset.rootfiles>
<fileset.depfun.included />
<fileset.depfun.excluded />
<fileset.package />
<build-deliverables>
<file location="${PROJECT_ROOT}" name="Bioformats Image Toolbox (v1.1.0).mltbx" optional="false">D:\Jian\Documents\Projects\coreCode\bioformats-image\code\build\Bioformats Image Toolbox (v1.1.0).mltbx</file>
<file location="${PROJECT_ROOT}" name="Bioformats Image Toolbox (v1.2.0).mltbx" optional="false">D:\Projects\Bioformats Image Toolbox\code\build\Bioformats Image Toolbox (v1.2.0).mltbx</file>
</build-deliverables>
<workflow />
<matlab>
Expand Down
31 changes: 26 additions & 5 deletions tbx/BioformatsImage/BioformatsImage.m
Expand Up @@ -272,8 +272,19 @@
function chNames = get.channelNames(obj)
chNames = cell(1,obj.sizeC);

for iC = 1:obj.sizeC
chNames{iC} = obj.metadata.getChannelName(0, iC - 1).char;
%Handle TIFF files
[~, ~, fExt] = fileparts(obj.filename);
switch lower(fExt)

case {'.tif', '.tiff'}
for iC = 1:obj.sizeC
chNames{iC} = int2str(iC);
end

otherwise
for iC = 1:obj.sizeC
chNames{iC} = obj.metadata.getChannelName(0, iC - 1).char;
end
end
end

Expand Down Expand Up @@ -429,7 +440,7 @@ function delete(obj)
end

end

function [timestamps, tsunits] = getTimestamps(obj, iZ, iC, varargin)
%GETTIMESTAMPS Get timestamps from the specified channel
%
Expand All @@ -447,6 +458,17 @@ function delete(obj)
ip.addOptional('TimeRange',Inf,@(x) all(isinf(x)) || isnumeric(x));
ip.parse(varargin{:});

%Handle TIFF files
[~, ~, fExt] = fileparts(obj.filename);
switch lower(fExt)

case {'.tif', '.tiff'}
timestamps = NaN;
tsunits = 'Not available';
return

end

%Resolve channel name
iC = obj.channelname2ind(iC);

Expand All @@ -458,8 +480,7 @@ function delete(obj)

%Initialize a vector for the timestamps
timestamps = zeros(1, numel(timeRange));



for iT = timeRange
%Resolve the bioformats index
bfIndex = obj.getIndex(iZ,iC,iT);
Expand Down

0 comments on commit 7e5e841

Please sign in to comment.