Skip to content

Commit cbb9fef

Browse files
Maxime ChamberlandMaxime Chamberland
authored andcommitted
update octree
1 parent 77728e6 commit cbb9fef

File tree

4 files changed

+29
-27
lines changed

4 files changed

+29
-27
lines changed

src/dataset/Fibers.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3773,9 +3773,9 @@ void Fibers::setFibersLength()
37733773
{
37743774
// The values are in pixel, we need to set them in millimeters using the spacing
37753775
// specified in the anatomy file ( m_datasetHelper->xVoxel... ).
3776-
dx = ( currentFiberPoints[i].x - currentFiberPoints[i - 1].x ) * voxelX;
3777-
dy = ( currentFiberPoints[i].y - currentFiberPoints[i - 1].y ) * voxelY;
3778-
dz = ( currentFiberPoints[i].z - currentFiberPoints[i - 1].z ) * voxelZ;
3776+
dx = ( currentFiberPoints[i].x - currentFiberPoints[i - 1].x );
3777+
dy = ( currentFiberPoints[i].y - currentFiberPoints[i - 1].y );
3778+
dz = ( currentFiberPoints[i].z - currentFiberPoints[i - 1].z );
37793779
FArray currentVector( dx, dy, dz );
37803780
m_length[j] += ( float )currentVector.norm();
37813781
}

src/dataset/Fibers.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ class Fibers : public DatasetInfo
111111
void setLocalGlobal(bool value);
112112
void setUsingEndpts(bool value);
113113

114-
void flipAxis( AxisType i_axe );
114+
void flipAxis( AxisType i_axe);
115115
void fitToAnat( bool saving);
116116

117117
int getFibersCount() const { return m_countLines; }

src/dataset/FibersGroup.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ class FibersGroup : public DatasetInfo
6666
bool load( wxString filename ) { return false; };
6767
void draw() {};
6868
void smooth() {};
69-
void flipAxis( AxisType i_axe ) {};
69+
void flipAxis( AxisType i_axe) {};
7070
void drawVectors() {};
7171
void generateTexture() {};
7272
void generateGeometry() {};

src/dataset/Octree.cpp

Lines changed: 24 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -37,35 +37,37 @@ Octree::~Octree()
3737
//////////////////////////////////////////
3838
void Octree::findBoundingBox()
3939
{
40-
m_maxPointX = m_pointArray[0];
41-
m_maxPointY = m_pointArray[1];
42-
m_maxPointZ = m_pointArray[2];
40+
DatasetManager *pDatMan = DatasetManager::getInstance();
4341

44-
m_minPointX = m_pointArray[0];
45-
m_minPointY = m_pointArray[1];
46-
m_minPointZ = m_pointArray[2];
42+
m_maxPointX = pDatMan->getColumns() * pDatMan->getVoxelX();
43+
m_maxPointY = pDatMan->getRows() * pDatMan->getVoxelY();
44+
m_maxPointZ = pDatMan->getFrames() * pDatMan->getVoxelZ();
4745

48-
//Find the bounding box for the dataSet
49-
for(int i=0; i < m_countPoints; i++)
50-
{
51-
if(m_pointArray[i*3] > m_maxPointX)
52-
m_maxPointX = m_pointArray[i*3];
46+
m_minPointX = 0.0f;
47+
m_minPointY = 0.0f;
48+
m_minPointZ = 0.0f;
5349

54-
if(m_pointArray[i*3+1] > m_maxPointY)
55-
m_maxPointY = m_pointArray[i*3+1];
50+
////Find the bounding box for the dataSet
51+
//for(int i=0; i < m_countPoints; i++)
52+
//{
53+
// if(m_pointArray[i*3] > m_maxPointX)
54+
// m_maxPointX = m_pointArray[i*3];
5655

57-
if(m_pointArray[i*3+2] > m_maxPointZ)
58-
m_maxPointZ = m_pointArray[i*3+2];
56+
// if(m_pointArray[i*3+1] > m_maxPointY)
57+
// m_maxPointY = m_pointArray[i*3+1];
5958

60-
if(m_pointArray[i*3] < m_minPointX)
61-
m_minPointX = m_pointArray[i*3];
59+
// if(m_pointArray[i*3+2] > m_maxPointZ)
60+
// m_maxPointZ = m_pointArray[i*3+2];
6261

63-
if(m_pointArray[i*3+1] < m_minPointY)
64-
m_minPointY = m_pointArray[i*3+1];
62+
// if(m_pointArray[i*3] < m_minPointX)
63+
// m_minPointX = m_pointArray[i*3];
6564

66-
if(m_pointArray[i*3+2] < m_minPointZ)
67-
m_minPointZ = m_pointArray[i*3+2];
68-
}
65+
// if(m_pointArray[i*3+1] < m_minPointY)
66+
// m_minPointY = m_pointArray[i*3+1];
67+
68+
// if(m_pointArray[i*3+2] < m_minPointZ)
69+
// m_minPointZ = m_pointArray[i*3+2];
70+
//}
6971
}
7072

7173
//////////////////////////////////////////

0 commit comments

Comments
 (0)