Skip to content
Snippets Groups Projects
Commit 4eec822d authored by Mickael Savinaud's avatar Mickael Savinaud
Browse files

ENH: add information about overviews into the JPEG2000ImageIO

parent 7d63cc96
Branches
Tags
No related merge requests found
...@@ -853,7 +853,6 @@ bool JPEG2000ImageIO::GetResolutionInfo(std::vector<unsigned int>& res, std::vec ...@@ -853,7 +853,6 @@ bool JPEG2000ImageIO::GetResolutionInfo(std::vector<unsigned int>& res, std::vec
return true; return true;
} }
/** Get all resolution in jpeg2000 file */
bool JPEG2000ImageIO::GetAvailableResolutions(std::vector<unsigned int>& res) bool JPEG2000ImageIO::GetAvailableResolutions(std::vector<unsigned int>& res)
{ {
res = this->m_InternalReaders[0]->GetAvailableResolutions(); res = this->m_InternalReaders[0]->GetAvailableResolutions();
...@@ -864,6 +863,18 @@ bool JPEG2000ImageIO::GetAvailableResolutions(std::vector<unsigned int>& res) ...@@ -864,6 +863,18 @@ bool JPEG2000ImageIO::GetAvailableResolutions(std::vector<unsigned int>& res)
return true; return true;
} }
unsigned int JPEG2000ImageIO::GetNumberOfOverviews()
{
std::vector<unsigned int> tempResList = this->m_InternalReaders[0]->GetAvailableResolutions();
if (tempResList.empty())
{
itkExceptionMacro(<< "Available resolutions in JPEG2000 is empty");
}
return tempResList.size() - 1;
}
// Read image // Read image
void JPEG2000ImageIO::Read(void* buffer) void JPEG2000ImageIO::Read(void* buffer)
......
...@@ -70,9 +70,15 @@ public: ...@@ -70,9 +70,15 @@ public:
/** Get Info about all resolution in jpeg2000 file */ /** Get Info about all resolution in jpeg2000 file */
bool GetResolutionInfo(std::vector<unsigned int>& res, std::vector<std::string>& desc); bool GetResolutionInfo(std::vector<unsigned int>& res, std::vector<std::string>& desc);
/** Get all resolutions in jpeg2000 file */ /** Get all resolution in jpeg2000 file from res = 0 which is the full resolution
* to nbReslution-1 which is most degraded*/
bool GetAvailableResolutions(std::vector<unsigned int>& res); bool GetAvailableResolutions(std::vector<unsigned int>& res);
/** Get number of available overviews in the jpeg2000 file
* ( if return = 0 => no overviews available because only one resolution
* is encoded in the file) */
unsigned int GetNumberOfOverviews();
/** Reads the data from disk into the memory buffer provided. */ /** Reads the data from disk into the memory buffer provided. */
virtual void Read(void* buffer); virtual void Read(void* buffer);
...@@ -136,6 +142,9 @@ private: ...@@ -136,6 +142,9 @@ private:
/** Resolution factor*/ /** Resolution factor*/
unsigned int m_ResolutionFactor; unsigned int m_ResolutionFactor;
/** */
unsigned int m_NumberOfOverviews;
/** Size of the cache used to reduce number of decoding operations*/ /** Size of the cache used to reduce number of decoding operations*/
unsigned int m_CacheSizeInByte; unsigned int m_CacheSizeInByte;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment