Skip to content

Commit

Permalink
ENH: enable writing ISQ files
Browse files Browse the repository at this point in the history
even when the ImageIO has not been used for reading
  • Loading branch information
dzenanz committed Feb 16, 2021
1 parent c2be6fd commit 08e269a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions include/itkScancoImageIO.h
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,8 @@ class IOScanco_EXPORT ScancoImageIO : public ImageIOBase
// The compression mode, if any.
int m_Compression;

bool m_HeaderInitialized = false;

SizeValueType m_HeaderSize{ 0 };
};
} // end namespace itk
Expand Down
6 changes: 6 additions & 0 deletions src/itkScancoImageIO.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,7 @@ ScancoImageIO::InitializeHeader()
this->m_MuWater = 0;

this->m_Compression = 0;
this->m_HeaderInitialized = true;
}


Expand Down Expand Up @@ -1270,6 +1271,11 @@ ScancoImageIO::CanWriteFile(const char * name)
void
ScancoImageIO::WriteISQHeader(std::ofstream * file)
{
if (!this->m_HeaderInitialized)
{
this->InitializeHeader();
this->SetVersion("CTDATA-HEADER_V1");
}
delete[] this->m_RawHeader;
this->m_RawHeader = new char[512];
char * header = this->m_RawHeader;
Expand Down

0 comments on commit 08e269a

Please sign in to comment.