Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
StochasticTractographyFilter.cxx
Go to the documentation of this file.
2 #include "itkVectorImage.h"
3 #include "itkImageSeriesReader.h" //this is needed for itk::ExposeMetaData()
4 #include "itkImageFileReader.h"
5 #include "itkImageFileWriter.h"
6 #include "itkMetaDataDictionary.h"
7 #include "itkAddImageFilter.h"
8 #include "itkUnaryFunctorImageFilter.h"
9 #include <iostream>
10 #include <vector>
11 #include "itkImageRegionConstIterator.h"
12 #include "StochasticTractographyFilterCLP.h"
13 #include "itkTensorFractionalAnisotropyImageFilter.h"
14 #include "itkPathIterator.h"
15 #include <string>
16 #include <fstream>
17 
18 std::string stripExtension(const std::string& fileName){
19  const int length = fileName.length();
20  for (int i=0; i!=length; ++i){
21  if (fileName[i]=='.'){
22  return fileName.substr(0,i);
23  }
24  }
25  return fileName;
26 }
27 
28 
29 template< class TTOContainerType >
30 bool SamplingDirections(const char* fn, typename TTOContainerType::Pointer directions){
31  char str[100];
32  double x,y,z;
33  std::ifstream m_file;
34  typename TTOContainerType::Element direction;
35 
36  //open the file
37  m_file.open(fn);
38  if(!m_file.is_open()){
39  std::cerr<<"Problems opening: "<< fn << std::endl;
40  return false;
41  }
42  else{
43  //load file info into valid itk representation
44  //assume all entries in the file describe a vector of length 1
45  //each line is arranged [x, y, z]
46  unsigned int directioncount=0;
47 
48  while(!m_file.getline(str, 100, '\n').eof()){
49  for(int i=0;i<3;i++){
50  sscanf(str,"%lf %lf %lf",&x,&y,&z);
51  direction[0]=x;
52  direction[1]=y;
53  direction[2]=z;
54  }
55  directions->InsertElement(directioncount++,direction);
56  }
57  }
58 
59  //close file
60  m_file.close();
61  return true;
62 }
63 
64 template< class TractContainerType >
65 bool WriteTractContainerToFile( const char* fn, TractContainerType* tractcontainer ){
66  std::ofstream tractfile( fn, std::ios::out | std::ios::binary );
67  tractfile.seekp(0);
68  if(tractfile.is_open()){
69  for(int i=0; i<tractcontainer->Size(); i++ ){
70  typename TractContainerType::Element tract =
71  tractcontainer->GetElement(i);
72 
74  tract->GetVertexList();
75 
76  for(int j=0; j<vertexlist->Size(); j++){
77  typename TractContainerType::Element::ObjectType::VertexListType::Element vertex =
78  vertexlist->GetElement(j);
79  tractfile.write((char*)&vertex[0], sizeof(vertex[0]));
80  tractfile.write((char*)&vertex[1], sizeof(vertex[1]));
81  tractfile.write((char*)&vertex[2], sizeof(vertex[2]));
82  }
83  double endoftractsymbol = 0.0;
84  tractfile.write((char*)&endoftractsymbol, sizeof(endoftractsymbol));
85  tractfile.write((char*)&endoftractsymbol, sizeof(endoftractsymbol));
86  tractfile.write((char*)&endoftractsymbol, sizeof(endoftractsymbol));
87  }
88 
89  tractfile.close();
90  return true;
91  }
92  else{
93  std::cerr<<"Problems opening file to write tracts\n";
94  return false;
95  }
96 }
97 template< class FAContainerType >
98 bool WriteScalarContainerToFile( const char* fn, FAContainerType* facontainer ){
99  std::ofstream fafile( fn, std::ios::out );
100  std::locale C("C"); // define standard locale
101  fafile.imbue(C); // switch the stream to standard locale
102 
103  if(fafile.is_open()){
104  for(int i=0; i<facontainer->Size(); i++){
105  fafile<<facontainer->GetElement(i)<<std::endl;
106  }
107  fafile.close();
108  return true;
109  }
110  else{
111  std::cerr<<"Problems opening file to write FA value\n";
112  return false;
113  }
114 }
115 
116 namespace Functor {
117 
118 template< class TInput, class TOutput>
119 class ZeroDWITest
120 {
121 public:
122  ZeroDWITest() {};
123  ~ZeroDWITest() {};
124  bool operator!=( const ZeroDWITest & ) const
125  {
126  return false;
127  }
128  bool operator==( const ZeroDWITest & other ) const
129  {
130  return !(*this != other);
131  }
132  inline TOutput operator()( const TInput & A )
133  {
134  /*for(int i=0;i<A.GetSize();i++){
135  if(A[0]<100){
136  std::cout<<"Invalid Voxel\n";
137  return 0;
138  }
139  }
140  */
141  return 10;
142  }
143 };
144 
145 template< class TInput, class TOutput>
146 class ScalarMultiply
147 {
148 public:
149  ScalarMultiply() {};
150  ~ScalarMultiply() {};
151  bool operator!=( const ScalarMultiply & ) const
152  {
153  return false;
154  }
155  bool operator==( const ScalarMultiply & other ) const
156  {
157  return !(*this != other);
158  }
159  inline TOutput operator()( const TInput & A )
160  {
161  /*for(int i=0;i<A.GetSize();i++){
162  if(A[0]<100){
163  std::cout<<"Invalid Voxel\n";
164  return 0;
165  }
166  }
167  */
168  return A*1000;
169  }
170 };
171 
172 }
173 
174 int main(int argc, char* argv[]){
175  PARSE_ARGS;
176  //define the input/output types
177  typedef itk::VectorImage< unsigned short int, 3 > DWIVectorImageType;
178  typedef itk::Image< float, 3 > WMPImageType;
179  typedef itk::Image< short int, 3 > ROIImageType;
180  typedef itk::Image< unsigned int, 3 > CImageType;
181 
182  //define an iterator for the ROI image
183  typedef itk::ImageRegionConstIterator< ROIImageType > ROIImageIteratorType;
184 
185  //define reader and writer
186  typedef itk::ImageFileReader< DWIVectorImageType > DWIVectorImageReaderType;
187  typedef itk::ImageFileReader< WMPImageType > WMPImageReaderType;
188  typedef itk::ImageFileReader< ROIImageType > ROIImageReaderType;
189  typedef itk::ImageFileWriter< CImageType > CImageWriterType;
190  typedef itk::ImageFileWriter< WMPImageType > WMPImageWriterType;
191 
192  //define metadata dictionary types
193  typedef itk::MetaDataDictionary DictionaryType;
194  typedef DictionaryType::ConstIterator DictionaryIteratorType;
195 
196  //define a probabilistic tractography filter type and associated bValue,
197  //gradient direction, and measurement frame types
198  typedef itk::StochasticTractographyFilter< DWIVectorImageType, WMPImageType,
199  CImageType >
200  PTFilterType;
201  typedef PTFilterType::bValueContainerType bValueContainerType;
202  typedef PTFilterType::GradientDirectionContainerType GDContainerType;
203  typedef PTFilterType::MeasurementFrameType MeasurementFrameType;
204 
205  //define a filter to generate a mask image that excludes zero dwi values
206  typedef Functor::ZeroDWITest< DWIVectorImageType::PixelType, WMPImageType::PixelType >
207  ZeroDWITestType;
208  typedef itk::UnaryFunctorImageFilter< DWIVectorImageType, WMPImageType,
209  ZeroDWITestType > ExcludeZeroDWIFilterType;
210 
211  //FA stuff
212  typedef itk::Image< double, 3 > FAImageType;
213  typedef itk::TensorFractionalAnisotropyImageFilter< PTFilterType::OutputTensorImageType,
214  FAImageType > FAFilterType;
215  typedef itk::ImageFileWriter< FAImageType > FAImageWriterType;
216 
217  //define a filter to multiply a FA image by 1000
218  typedef Functor::ScalarMultiply< FAImageType::PixelType, FAImageType::PixelType >
219  ScalarMultiplyType;
220  typedef itk::UnaryFunctorImageFilter< FAImageType, FAImageType,
221  ScalarMultiplyType > MultiplyFAFilterType;
222 
223  //define AddImageFilterType to accumulate the connectivity maps of the pixels in the ROI
224  typedef itk::AddImageFilter< CImageType, CImageType, CImageType> AddImageFilterType;
225 
226  //parse command line arguments
227  //if(argc < 3){
228  // std::cerr << "Usage: " << argv[0];
229  // std::cerr<< " DWIFile(.nhdr) ROIFile(.nhdr) ConnectivityFile(.nhdr) ";
230  // std::cerr<< "LabelNumber NumberOfTracts MaxTractLength MaxLikelihoodCacheSize\n";
231  // return EXIT_FAILURE;
232  //}
233  /*
234  char* dwifilename = argv[1];
235  char* roifilename = argv[2];
236  char* cfilename = argv[3];
237  unsigned int labelnumber = atoi(argv[4]);
238  unsigned int totaltracts = atoi(argv[5]);
239  unsigned int maxtractlength = atoi(argv[6]);
240  unsigned int maxlikelihoodcachesize = atoi(argv[7]);
241  */
242  //setup output stat files
243  std::string fafilename = outputprefix + "_CONDFAValues.txt";
244  //sprintf( fafilename, "%s_CONDFAValues.txt", outputprefix.c_str() );
245  std::string lengthfilename = outputprefix + "_CONDLENGTHValues.txt";
246  //sprintf( lengthfilename, "%s_CONDLENGTHValues.txt", outputprefix.c_str() );
247 
248  //open these files
249  std::ofstream fafile( fafilename.c_str() );
250  std::locale C("C"); // define standard locale
251  fafile.imbue(C); // switch the stream to standard locale
252 
253  if(!fafile.is_open()){
254  std::cerr<<"Could not open FA file!\n";
255  return EXIT_FAILURE;
256  }
257 
258  std::ofstream lengthfile( lengthfilename.c_str() );
259  lengthfile.imbue(C); // switch the stream to standard locale
260  //if(!lengthfile.is_open()){
261  // std::cerr<<"Could not open Length file!\n";
262  // return EXIT_FAILURE;
263  // }
264 
265  //read in the DWI image
267  dwireaderPtr->SetFileName(dwifilename);
268  dwireaderPtr->Update();
269 
270  //Obtain bValue, gradient directions and measurement frame from metadata dictionary
271  DictionaryType& dictionary = dwireaderPtr->GetMetaDataDictionary();
273  MeasurementFrameType measurement_frame;
275  bValueContainerType::Element scaling_bValue = 0;
276  GDContainerType::Element g_i;
277 
278  //bad choice of variable names: dictit->first refers to the key in the Map
279  //dictit->second refers to the Value associated with that Key
280  for(DictionaryIteratorType dictit = dictionary.Begin();
281  dictit!=dictionary.End();
282  ++dictit){
283  if(dictit->first.find("DWMRI_gradient") != std::string::npos){
284  std::string metaDataValue;
285  itk::ExposeMetaData< std::string > (dictionary, dictit->first, metaDataValue);
286  sscanf(metaDataValue.c_str(), "%lf %lf %lf\n", &g_i[0], &g_i[1], &g_i[2]);
287  //normalize the gradient vector
288  gradientsPtr->InsertElement( gradientsPtr->Size(), g_i.normalize() );
289  }
290  else if(dictit->first.find("DWMRI_b-value") != std::string::npos){
291  std::string metaDataValue;
292  itk::ExposeMetaData< std::string >(dictionary, dictit->first, metaDataValue);
293  scaling_bValue = atof(metaDataValue.c_str());
294  }
295  else if(dictit->first.find("NRRD_measurement frame") != std::string::npos){
296  std::vector< std::vector < double > > metaDataValue;
297  itk::ExposeMetaData< std::vector< std::vector<double> > >
298  (dictionary, dictit->first, metaDataValue);
299  for(int i=0;i<3;i++){
300  for(int j=0;j<3;j++)
301  measurement_frame(i,j) = metaDataValue[j][i];
302  }
303  }
304  else{
305  std::cout << dictit->first << std::endl;
306  }
307  }
308 
309  //check to see if bValue, gradients, or measurement frame is missing
310  if(scaling_bValue == 0){
311  std::cerr << "scaling_bValue should never be 0, possibly not found in Nrrd header\n";
312  return EXIT_FAILURE;
313  }
314  else if(gradientsPtr->Size() == 0){
315  std::cerr <<"no gradients were found!";
316  return EXIT_FAILURE;
317  }
318  else if(measurement_frame.size() == 0){
319  std::cerr <<"no measurement frame was found!";
320  return EXIT_FAILURE;
321  }
322  //correct the measurement frame
323 
324  std::cout << scaling_bValue << std::endl;
325  for(unsigned int i=0; i<gradientsPtr->Size(); i++)
326  std::cout << gradientsPtr->GetElement(i) << std::endl;
327 
328  //std::cout << measurement_frame <<std::endl;
329 
330  for(unsigned int i=0; i<measurement_frame.rows(); i++){
331  for(unsigned int j=0; j<measurement_frame.columns(); j++){
332  std::cout<<measurement_frame(i,j) << " ";
333  }
334  std::cout << std::endl;
335  }
336 
337  //correct the measurement frame since the image is now in LPS from RAS frame
338  //NRRDIO should do this, but we do it here as a work around
339 
340  //fill up bValue container with the scaling_bValue;
341  for(unsigned int i=0; i<gradientsPtr->Size() ;i++){
342  if(gradientsPtr->GetElement(i).squared_magnitude() == 0){
343  bValuesPtr->InsertElement(i, 0);
344  }
345  else{
346  //this matters in the calculations for the constrained model but not the tensor model
347  //since a gradient direction of all zeros handles it
348  bValuesPtr->InsertElement(i, scaling_bValue);
349  }
350  }
351 
352  //setup the ROI image reader
354  roireaderPtr->SetFileName(roifilename);
355  roireaderPtr->Update();
356 
357  //setup the white matter probability image reader
359  wmpreader->SetFileName(wmpfilename);
360  wmpreader->Update();
361 
362  //optionally set the origins of these images to be the same as the DWI
363  if(recenteroriginswitch==true){
364  roireaderPtr->GetOutput()->SetOrigin( dwireaderPtr->GetOutput()->GetOrigin() );
365  wmpreader->GetOutput()->SetOrigin( dwireaderPtr->GetOutput()->GetOrigin() );
366  }
367  /*
368  //set list of directions
369  typedef PTFilterType::TractOrientationContainerType TOCType;
370  TOCType::Pointer directionsPtr = TOCType::New();
371 
372  if(SamplingDirections<TOCType>("SD.txt", directionsPtr));
373  else return EXIT_FAILURE;
374  */
375  /*
376  //write out the directions
377  std::ofstream outfile("crapola.txt");
378 
379 
380  for(int i=0; i<directionsPtr->Size(); i++){
381  TOCType::Element dir = directionsPtr->GetElement(i);
382  outfile<<"{"<<dir[0]<<", "<<dir[1]<<", "<<dir[2]<<"},"<<std::endl;
383  }
384  outfile.close();
385  */
386 
387  //Create a default Mask Image which
388  //excludes DWI pixels which contain values that are zero
389  //ExcludeZeroDWIFilterType::Pointer ezdwifilter = ExcludeZeroDWIFilterType::New();
390  //ezdwifilter->SetInput( dwireaderPtr->GetOutput() );
391  //std::cout<<"Start mask image\n";
392  //write out the mask image
393  //MaskImageWriterType::Pointer maskwriterPtr = MaskImageWriterType::New();
394  //maskwriterPtr->SetInput( ezdwifilter->GetOutput() );
395  //maskwriterPtr->SetFileName( "maskimage.nhdr" );
396  //maskwriterPtr->Update();
397  //std::cout<<"Finish the mask image\n";
398 
399  std::cout<<"Create PTFilter\n";
400  //Setup the PTFilter
402  ptfilterPtr->SetInput( dwireaderPtr->GetOutput() );
403  //ptfilterPtr->SetMaskImageInput( ezdwifilter->GetOutput() );
404  ptfilterPtr->SetWhiteMatterProbabilityImageInput( wmpreader->GetOutput() );
405  ptfilterPtr->SetbValues(bValuesPtr);
406  ptfilterPtr->SetGradients( gradientsPtr );
407  ptfilterPtr->SetMeasurementFrame( measurement_frame );
408  //ptfilterPtr->SetSampleDirections(directionsPtr);
409  ptfilterPtr->SetMaxTractLength( maxtractlength );
410  ptfilterPtr->SetTotalTracts( totaltracts );
411  ptfilterPtr->SetMaxLikelihoodCacheSize( maxlikelihoodcachesize );
412  if(totalthreads!=0) ptfilterPtr->SetNumberOfThreads( totalthreads );
413 
414  //calculate the tensor image
415  ptfilterPtr->GenerateTensorImageOutput();
416 
417  //Setup the FAImageFilter
419 
420  fafilter->SetInput( ptfilterPtr->GetOutputTensorImage() );
421  fafilter->Update();
422 
423  //Setup the FA container to hold FA values for tracts of interest
424  typedef itk::VectorContainer< unsigned int, double > FAContainerType;
425  //FAContainerType::Pointer facontainer = FAContainerType::New();
426 
427  //Setup the length container to hold lengths for tracts of interest
428  typedef itk::VectorContainer< unsigned int, unsigned int > LengthContainerType;
429  //LengthContainerType::Pointer lengthcontainer = LengthContainerType::New();
430 
431  //Setup the AddImageFilter
433 
434  //Create a zeroed Connectivity Image
435  CImageType::Pointer accumulatedcimagePtr = CImageType::New();
436  accumulatedcimagePtr->CopyInformation( dwireaderPtr->GetOutput() );
437  accumulatedcimagePtr->SetBufferedRegion( dwireaderPtr->GetOutput()->GetBufferedRegion() );
438  accumulatedcimagePtr->SetRequestedRegion( dwireaderPtr->GetOutput()->GetRequestedRegion() );
439  accumulatedcimagePtr->Allocate();
440  accumulatedcimagePtr->FillBuffer(0);
441 
442  //Create another Connectivity Map for just the tracts
443  //which make it to the second ROI
444  CImageType::Pointer conditionedcimagePtr = CImageType::New();
445  conditionedcimagePtr->CopyInformation( dwireaderPtr->GetOutput() );
446  conditionedcimagePtr->SetBufferedRegion( dwireaderPtr->GetOutput()->GetBufferedRegion() );
447  conditionedcimagePtr->SetRequestedRegion( dwireaderPtr->GetOutput()->GetRequestedRegion() );
448  conditionedcimagePtr->Allocate();
449  conditionedcimagePtr->FillBuffer(0);
450 
451  //graft this onto the output of the addimagefilter
452  addimagefilterPtr->GraftOutput(accumulatedcimagePtr);
453  addimagefilterPtr->SetInput1(ptfilterPtr->GetOutput());
454  addimagefilterPtr->SetInput2(addimagefilterPtr->GetOutput());
455 
456  ROIImageIteratorType ROIImageIt( roireaderPtr->GetOutput(),
457  roireaderPtr->GetOutput()->GetRequestedRegion() );
458  for(ROIImageIt.GoToBegin(); !ROIImageIt.IsAtEnd(); ++ROIImageIt){
459  if(ROIImageIt.Get() == labelnumber){
460  std::cout << "PixelIndex: "<< ROIImageIt.GetIndex() << std::endl;
461  ptfilterPtr->SetSeedIndex( ROIImageIt.GetIndex() );
462  //ptfilterPtr->GenerateTractContainerOutput();
463  //write out the tract info
464 
465  //WriteTractContainerToFile( filename, ptfilterPtr->GetOutputTractContainer() );
466  addimagefilterPtr->Update();
467 
468  std::cout<<"Calculate Statistics\n";
469  //calculate the FA stats for tracts which pass through a second ROI
471  ptfilterPtr->GetOutputTractContainer();
472 
473  typedef itk::PathIterator< ROIImageType, PTFilterType::TractType >
474  ROITractIteratorType;
475 
476  for(int i=0; i<tractcontainer->Size(); i++ ){
477  PTFilterType::TractType::Pointer currtract = tractcontainer->GetElement(i);
478  ROITractIteratorType roitractIt( roireaderPtr->GetOutput(),
479  currtract );
480 
481  for(roitractIt.GoToBegin(); !roitractIt.IsAtEnd(); ++roitractIt){
482  if(roitractIt.Get() == endlabelnumber){
483  double accumFA=0;
484  unsigned int stepcount=0;
485  //integrate fa along length of tract
486  for(double t=0; t<currtract->EndOfInput(); t+=0.2){
487  stepcount++;
488  //std::cout<<fafilter->GetOutput()->GetPixel(roitractIt.GetIndex())<<std::endl;
489  accumFA+=fafilter->GetOutput()->GetPixel(currtract->EvaluateToIndex(t));
490  }
491  fafile<<accumFA/((double)stepcount)<<std::endl;
492  lengthfile<<tractcontainer->GetElement(i)->EndOfInput()<<std::endl;
493  if(fafile.fail() || lengthfile.fail() ){
494  std::cerr<<"Error writing to text files\n";
495  return EXIT_FAILURE;
496  }
497  //lengthcontainer->InsertElement( lengthcontainer->Size(),
498  //(unsigned int) tractcontainer->GetElement(i)->EndOfInput() );
499  //facontainer->InsertElement( facontainer->Size(), accumFA/((double)stepcount) );
500 
501  //color in the tracts
502  for(roitractIt.GoToBegin(); !roitractIt.IsAtEnd(); ++roitractIt){
503  conditionedcimagePtr->GetPixel(roitractIt.GetIndex())++;
504  }
505  break;
506  }
507  }
508  }
509  }
510  }
511 
512  std::cout<<"DWI image origin:"<< dwireaderPtr->GetOutput()->GetOrigin() <<std::endl;
513  std::cout<<"ROI image origin:"<< roireaderPtr->GetOutput()->GetOrigin() <<std::endl;
514  std::cout<<"wmp image origin:"<< wmpreader->GetOutput()->GetOrigin() <<std::endl;
515  if(outputimageswitch){
516  //Write out the Connectivity Map
517  std::string cfilename = outputprefix + "_CMAP.nhdr";
518  //sprintf(cfilename, "%s_CMAP.nhdr", outputprefix.c_str() );
520  writerPtr->SetInput( accumulatedcimagePtr );
521  writerPtr->SetFileName( cfilename.c_str() );
522  writerPtr->Update();
523 
524  //Write out TensorImage
525  std::string tensorimagefilename = outputprefix + "_TENSOR.nhdr";
526  //sprintf(tensorimagefilename, "%s_TENSOR.nhdr", outputprefix.c_str() );
527  typedef itk::ImageFileWriter< PTFilterType::OutputTensorImageType > TensorImageWriterType;
529  tensorwriter->SetInput( ptfilterPtr->GetOutputTensorImage() );
530  tensorwriter->SetFileName( tensorimagefilename.c_str() );
531  tensorwriter->Update();
532 
533  //Create a default Mask Image which
534  //excludes DWI pixels which contain values that are zero
536  multFAfilter->SetInput( fafilter->GetOutput() );
537  //write out the FA image
538  std::string faimagefilename = outputprefix + "_FA.nhdr";
539  //sprintf(faimagefilename, "%s_FA.nhdr", outputprefix.c_str() );
541  fawriter->SetInput( multFAfilter->GetOutput() );
542  fawriter->SetFileName( faimagefilename.c_str() );
543  fawriter->Update();
544 
545  //Write out the conditioned connectivity map
546  CImageWriterType::Pointer condcmapwriterPtr = CImageWriterType::New();
547  condcmapwriterPtr->SetInput( conditionedcimagePtr );
548  std::string condcmapfilename = outputprefix + "_COND.nhdr";
549  //sprintf(condcmapfilename, "%s_COND.nhdr", outputprefix.c_str());
550  condcmapwriterPtr->SetFileName( condcmapfilename );
551  condcmapwriterPtr->Update();
552  }
553  //close files
554  fafile.close();
555  lengthfile.close();
556  if(fafile.fail() || lengthfile.fail() ){
557  std::cerr<<"Error closing text files\n";
558  return EXIT_FAILURE;
559  }
560  //Write out FA container
561  //char fafilename[100];
562  //sprintf( fafilename, "%s_CONDFAValues.txt", outputprefix.c_str() );
563  //WriteScalarContainerToFile< FAContainerType >( fafilename, facontainer );
564 
565  //Write out tract length container
566  //char lengthfilename[100];
567  //sprintf( lengthfilename, "%s_CONDLENGTHValues.txt", outputprefix.c_str() );
568  //WriteScalarContainerToFile< LengthContainerType >( lengthfilename, lengthcontainer );
569  return EXIT_SUCCESS;
570 }
int main(int argc, char *argv[])
itk::SmartPointer< Self > Pointer
MITKCORE_EXPORT bool operator!=(const InteractionEvent &a, const InteractionEvent &b)
bool WriteTractContainerToFile(const char *fn, TractContainerType *tractcontainer)
std::string stripExtension(const std::string &fileName)
MITKCORE_EXPORT bool operator==(const InteractionEvent &a, const InteractionEvent &b)
itk::SmartPointer< const Self > ConstPointer
std::vector< TractType > TractContainerType
bool WriteScalarContainerToFile(const char *fn, FAContainerType *facontainer)
bool SamplingDirections(const char *fn, typename TTOContainerType::Pointer directions)
static itkEventMacro(BoundingShapeInteractionEvent, itk::AnyEvent) class MITKBOUNDINGSHAPE_EXPORT BoundingShapeInteractor Pointer New()
Basic interaction methods for mitk::GeometryData.