8 #include "PlusConfigure.h" 18 #include <itkLandmarkSpatialObject.h> 20 int main(
int argc,
char* argv[])
24 vtkSmartPointer<vtkFcsvReader> reader = vtkSmartPointer<vtkFcsvReader>::New();
26 reader->SetFileName(argv[1]);
29 LOG_DEBUG(
"Number Of Points: " << reader->GetFcsvDataObject().points.size());
30 if (reader->GetFcsvDataObject().points.size() != 18)
32 LOG_ERROR(
"Number Of Points: mismatch");
38 reader->GetFcsvPoint(2).position[0] = 100;
39 reader->GetFcsvPoint(2).position[1] = 200;
40 reader->GetFcsvPoint(2).position[2] = 300;
41 reader->GetFcsvPoint(2).selected = 0;
42 reader->GetFcsvPoint(2).visibility = 1;
44 catch (
const std::out_of_range& ex)
51 vtkSmartPointer<vtkFcsvWriter> writer = vtkSmartPointer<vtkFcsvWriter>::New();
52 writer->SetFileName(argv[2]);
53 writer->CopyFcsvDataObject(reader->GetFcsvDataObject());
57 vtkSmartPointer<vtkFcsvReader> reader2 = vtkSmartPointer<vtkFcsvReader>::New();
58 reader2->SetFileName(argv[2]);
61 LOG_DEBUG(
"Number Of Points: " << reader2->GetFcsvDataObject().points.size());
62 if (reader2->GetFcsvDataObject().points.size() != 18)
64 LOG_ERROR(
"Number Of Points: mismatch");
69 std::vector<FcsvPoint>::const_iterator it = reader2->GetFcsvDataObject().points.begin();
70 while (it != reader2->GetFcsvDataObject().points.end())
72 LOG_DEBUG(
"Point position: " << (*it).position);
75 if ((*it).position[0] != 100)
77 LOG_ERROR(
"Position[0] mismatch");
80 if ((*it).position[1] != 200)
82 LOG_ERROR(
"Position[1] mismatch");
85 if ((*it).position[2] != 300)
87 LOG_ERROR(
"Position[2] mismatch");
90 if ((*it).selected != 0)
92 LOG_ERROR(
"selected mismatch");
95 if ((*it).visibility != 1)
97 LOG_ERROR(
"visibility mismatch");
static vtkIGSIOLogger * Instance()
int main(int argc, char *argv[])