Commit 37d752c1 authored by kulvait's avatar kulvait

Formating

*Changed error message in src/rawop.cpp
parent bff68258
......@@ -50,13 +50,14 @@ namespace io {
uint32_t dimz() const override;
std::string getFileName() const;
/**Returns file name of the underlying DEN file.**/
protected:
protected:
std::string denFile;
uint64_t offset;
// protected: // Visible in inheritance structure
uint32_t sizex, sizey, sizez;
DenSupportedType dataType;
int elementByteSize;
private:
mutable std::mutex* consistencyMutexes;
uint8_t** buffers;
......
......@@ -27,8 +27,8 @@ namespace io {
std::string projectionMatrixFile;
DenSupportedType dataType;
uint32_t elementByteSize;
uint64_t offsetMatrix = 6;
uint64_t offsetProjections = 6;
uint64_t offsetMatrix = 6;
uint64_t offsetProjections = 6;
public:
DenProjectionReader(std::string projectionsFile, std::string projectionMatrixFile);
......@@ -59,8 +59,8 @@ namespace io {
this->sizex = pi.dimx();
this->sizey = pi.dimy();
this->sizez = pi.dimz();
this->offsetMatrix = mi.getOffset();
this->offsetProjections = mi.getOffset();
this->offsetMatrix = mi.getOffset();
this->offsetProjections = mi.getOffset();
uint32_t cols, rows, matCount;
cols = mi.getNumCols(); // Its matrix, dealing with strange data format considerations
rows = mi.getNumRows(); // Its matrix, dealing with strange data format considerations
......@@ -142,7 +142,8 @@ namespace io {
std::shared_ptr<io::Frame2DI<T>> DenProjectionReader<T>::readProjectionSlice(int sliceNum)
{
uint8_t* buffer = new uint8_t[elementByteSize * sizex * sizey];
uint64_t position = this->offsetProjections + ((uint64_t)sliceNum) * elementByteSize * sizex * sizey;
uint64_t position
= this->offsetProjections + ((uint64_t)sliceNum) * elementByteSize * sizex * sizey;
io::readBytesFrom(this->projectionsFile, position, buffer, elementByteSize * sizex * sizey);
T* buffer_copy = new T[sizex * sizey];
for(int a = 0; a != sizex * sizey; a++)
......@@ -160,7 +161,8 @@ namespace io {
void* DenProjectionReader<T>::readNakedMemory(int sliceNum)
{
uint8_t* buffer = new uint8_t[elementByteSize * sizex * sizey];
uint64_t position = this->offsetProjections + ((uint64_t)sliceNum) * elementByteSize * sizex * sizey;
uint64_t position
= this->offsetProjections + ((uint64_t)sliceNum) * elementByteSize * sizex * sizey;
io::readBytesFrom(this->projectionsFile, position, buffer, elementByteSize * sizex * sizey);
return buffer;
}
......
......@@ -54,7 +54,8 @@ namespace io {
if(!file.is_open()) // cannot open file
{
std::stringstream errMsg;
errMsg << "Can not open file " << fileName << ".";
errMsg << "Can not open file " << fileName << "failed with message" << strerror(errno)
<< ".";
LOGE << errMsg.str();
throw std::runtime_error(errMsg.str());
}
......@@ -184,7 +185,7 @@ namespace io {
{
return std::experimental::filesystem::is_directory(p);
}
bool isRegularFile(const std::experimental::filesystem::path& p)
{
return std::experimental::filesystem::is_regular_file(p);
......@@ -297,8 +298,8 @@ namespace io {
{
if(!isRegularFile(f))
{
std::string ERR
= io::xprintf("File %s from the files to concatenate is not regular file!", f.c_str());
std::string ERR = io::xprintf(
"File %s from the files to concatenate is not regular file!", f.c_str());
LOGE << ERR;
throw std::ios_base::failure(ERR);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment