Skip to content

Commit

Permalink
Fixed bug where data could not be loaded into DataInMemory
Browse files Browse the repository at this point in the history
  • Loading branch information
AlanRace committed Mar 14, 2019
1 parent f986ed6 commit d9e4568
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/core/DataInMemory.m
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,10 @@ function loadData(obj, parser, regionOfInterest, spectralChannelRange, zeroFilli
end

if(isempty(obj.data))
if(isinf(spectralChannelRange(1)))
if(isinf(spectralChannelRange(1)) && ~isempty(spectralChannels))
spectralChannelRange(1) = min(spectralChannels);
end
if(isinf(spectralChannelRange(2)))
if(isinf(spectralChannelRange(2)) && ~isempty(spectralChannels))
spectralChannelRange(2) = max(spectralChannels);
end

Expand Down
12 changes: 6 additions & 6 deletions src/io/ImzMLParser.m
Original file line number Diff line number Diff line change
Expand Up @@ -68,16 +68,16 @@ function parse(obj)
if(isempty(imzMLSpectrum))
spectralChannels = [];
intensities = [];

return;
else
spectralChannels = imzMLSpectrum.getmzArray();
intensities = imzMLSpectrum.getIntensityArray();
end

spectralChannels = imzMLSpectrum.getmzArray();
intensities = imzMLSpectrum.getIntensityArray();

spectrum = SpectralData(spectralChannels, intensities);

spectrum.setIsContinuous(~imzMLSpectrum.isCentroid());
if(~isempty(imzMLSpectrum))
spectrum.setIsContinuous(~imzMLSpectrum.isCentroid());
end
end

function image = getImage(obj, spectralChannel, channelWidth)
Expand Down

0 comments on commit d9e4568

Please sign in to comment.