GetNumberOfCells(); i++)
{
vtkCell* cell = m_FiberPolyData->GetCell(i);
int p = cell->GetNumberOfPoints();
vtkPoints* points = cell->GetPoints();
for (int j=0; jGetPoint(j, p);
if (p[0]b[1])
b[1]=p[0];
if (p[1]b[3])
b[3]=p[1];
if (p[2]b[5])
b[5]=p[2];
}
}
// provide some buffer space at borders
for(int i=0; i<=4; i+=2){
b[i] -=10;
}
for(int i=1; i<=5; i+=2){
b[i] +=10;
}
mitk::Geometry3D::Pointer geometry = mitk::Geometry3D::New();
geometry->SetImageGeometry(true);
geometry->SetFloatBounds(b);
this->SetGeometry(geometry);
}
/*==============================
*++++ FIBER INFORMATION +++++++
===============================*/
QStringList mitk::FiberBundleX::GetAvailableColorCodings()
{
QStringList availableColorCodings;
int numColors = m_FiberPolyData->GetPointData()->GetNumberOfArrays();
for(int i=0; iGetPointData()->GetArrayName(i));
}
//this controlstructure shall be implemented by the calling method
if (availableColorCodings.isEmpty())
MITK_INFO << "no colorcodings available in fiberbundleX";
// for(int i=0; im_currentColorCoding;
}
void mitk::FiberBundleX::SetColorCoding(const char* requestedColorCoding)
{
// MITK_INFO << "FbX try to set colorCoding: " << requestedColorCoding << " compare with: " << COLORCODING_ORIENTATION_BASED;
if(strcmp (COLORCODING_ORIENTATION_BASED,requestedColorCoding) == 0 )
{
this->m_currentColorCoding = (char*) COLORCODING_ORIENTATION_BASED;
this->m_isModified = true;
} else if(strcmp (COLORCODING_FA_BASED,requestedColorCoding) == 0 ) {
this->m_currentColorCoding = (char*) COLORCODING_FA_BASED;
this->m_isModified = true;
} else {
MITK_INFO << "FIBERBUNDLE X: UNKNOWN COLORCODING in FIBERBUNDLEX Datastructure";
this->m_currentColorCoding = "---"; //will cause blank colorcoding of fibers
this->m_isModified = true;
}
}
bool mitk::FiberBundleX::isFiberBundleXModified()
{
return m_isModified;
}
void mitk::FiberBundleX::setFBXModificationDone()
{
m_isModified = false;
}
/* ESSENTIAL IMPLEMENTATION OF SUPERCLASS METHODS */
void mitk::FiberBundleX::UpdateOutputInformation()
{
}
void mitk::FiberBundleX::SetRequestedRegionToLargestPossibleRegion()
{
}
bool mitk::FiberBundleX::RequestedRegionIsOutsideOfTheBufferedRegion()
{
return false;
}
bool mitk::FiberBundleX::VerifyRequestedRegion()
{
return true;
}
void mitk::FiberBundleX::SetRequestedRegion( itk::DataObject *data )
{
}
diff --git a/Modules/DiffusionImaging/IODataStructures/FiberBundleX/mitkFiberBundleX.h b/Modules/DiffusionImaging/IODataStructures/FiberBundleX/mitkFiberBundleX.h
index 9023b4d8c2..cd0efe74a9 100644
--- a/Modules/DiffusionImaging/IODataStructures/FiberBundleX/mitkFiberBundleX.h
+++ b/Modules/DiffusionImaging/IODataStructures/FiberBundleX/mitkFiberBundleX.h
@@ -1,129 +1,131 @@
/*=========================================================================
Program: Medical Imaging & Interaction Toolkit
Module: $RCSfile$
Language: C++
Date: $Date$
Version: $Revision: 11989 $
Copyright (c) German Cancer Research Center, Division of Medical and
Biological Informatics. All rights reserved.
See MITKCopyright.txt or http://www.mitk.org/copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notices for more information.
=========================================================================*/
/* =============== IMPORTANT TODO ===================
* ==== USE vtkSmartPointer<> when necessary ONLY!!!!
*/
#ifndef _MITK_FiberBundleX_H
#define _MITK_FiberBundleX_H
//includes for MITK datastructure
#include
#include "MitkDiffusionImagingExports.h"
//includes storing fiberdata
#include //may be replaced by class precompile argument
#include // may be replaced by class
#include // my be replaced by class
#include
#include
+#include
+
namespace mitk {
/**
* \brief Base Class for Fiber Bundles; */
class MitkDiffusionImaging_EXPORT FiberBundleX : public BaseData
{
public:
// names of certain arrays (e.g colorcodings, etc.)
static const char* COLORCODING_ORIENTATION_BASED;
static const char* COLORCODING_FA_BASED;
static const char* FIBER_ID_ARRAY;
/* friend classes wanna access typedefs
ContainerPointType, ContainerTractType, ContainerType */
friend class FiberBundleXWriter;
friend class FiberBundleXReader;
// ======virtual methods must have======
virtual void UpdateOutputInformation();
virtual void SetRequestedRegionToLargestPossibleRegion();
virtual bool RequestedRegionIsOutsideOfTheBufferedRegion();
virtual bool VerifyRequestedRegion();
virtual void SetRequestedRegion( itk::DataObject *data );
//=======================================
mitkClassMacro( FiberBundleX, BaseData )
itkNewMacro( Self )
//custom constructor with passing argument
mitkNewMacro1Param(Self, vtkSmartPointer)
/*====FIBERBUNDLE I/O METHODS====*/
void SetFiberPolyData(vtkSmartPointer); //set result of tractography algorithm in vtkPolyData format using vtkPolyLines
vtkSmartPointer GetFiberPolyData();
void UpdateFiberGeometry();
char* GetCurrentColorCoding();
QStringList GetAvailableColorCodings();
void SetColorCoding(const char*);
bool isFiberBundleXModified();
void setFBXModificationDone();
/*===FIBERBUNDLE PROCESSING METHODS====*/
void DoColorCodingOrientationbased();
void DoGenerateFiberIds();
- std::vector DoGetFiberIds(/* mitkPlanarfigure slicing plane*/);
+ std::vector DoExtractFiberIds(mitk::PlanarFigure::Pointer );
/*===FIBERBUNDLE ASSESSMENT METHODS====*/
protected:
FiberBundleX( vtkSmartPointer fiberPolyData = NULL );
virtual ~FiberBundleX();
private:
// The following polydata variables are used for fiber- and pointbased representation of the tractography results. As VTK suggests, one vtkPolyData is used to manage vertices and the other for polylines.
// FiberPolyData stores all brain fibers using polylines (in world coordinates)
// this variable hosts the smoothed fiber data, this data we generate, therefore a smartpointer structure is recommended
// vtkSmartPointer m_FiberPolyData; is depricated
//
// this variable hosts the original fiber data, no smartpointer needed because who or whatever passes this data to FiberBundleX should use vtkSmartPointer structure
vtkSmartPointer m_FiberPolyData; //this is a common pointer because fiberDataStructure gets passed to this class. m_FiberStructureData is destroyed in the destructor then.
// this variable contains all additional IDs of Fibers which are needed for efficient fiber manipulation such as extracting etc.
vtkSmartPointer m_FiberIdDataSet;
char* m_currentColorCoding;
//this flag conzerns only visual representation.
bool m_isModified;
};
} // namespace mitk
#endif /* _MITK_FiberBundleX_H */