mirror of
https://github.com/brmlab/medirap.git
synced 2025-12-15 13:43:58 +01:00
init
This commit is contained in:
commit
a0d3dba238
827 changed files with 1224 additions and 0 deletions
29
qt/voxeldata.cpp
Normal file
29
qt/voxeldata.cpp
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
#include "voxeldata.h"
|
||||
#include <QFile>
|
||||
#include <QImage>
|
||||
#include <QTextStream>
|
||||
#include <QDebug>
|
||||
|
||||
bool VoxelData::load(QString path, QString filename)
|
||||
{
|
||||
qDebug() << "Processing " + path + "/" + filename + " ...";
|
||||
QFile file(path + "/" + filename);
|
||||
if (!file.open(QIODevice::ReadOnly | QIODevice::Text))
|
||||
return false;
|
||||
QTextStream in(&file);
|
||||
int i = 0;
|
||||
data = new VOXELDATA[512*512*512];
|
||||
while (!in.atEnd()) {
|
||||
QString line = in.readLine();
|
||||
QImage img;
|
||||
qDebug() << "Loading " + line + " ...";
|
||||
img.load(path + "/" + line);
|
||||
dimx = img.width();
|
||||
dimy = img.height();
|
||||
qDebug() << img.format() ;
|
||||
i++;
|
||||
}
|
||||
dimz = i;
|
||||
file.close();
|
||||
return true;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue