45 #if defined ( ENABLEFFMPEG ) || defined ( ENABLEAVI )
59 #include "vtkImageData.h"
61 #include "vtkLookupTable.h"
62 #include "vtkImageAppendComponents.h"
63 #include "vtkOrientedGlyphContourRepresentation.h"
64 #include "vtkContourWidget.h"
65 #include "vtkProperty.h"
66 #include "vtkPolyData.h"
67 #include "vtkImageActorPointPlacer.h"
72 #include "vtkCellArray.h"
74 #include "vtkPolyData.h"
76 #include "vtkPolyDataMapper.h"
77 #include "vtkOutlineFilter.h"
80 #include "vtkImageExport.h"
92 #include <QVBoxLayout>
93 #include <QColorDialog>
94 #include <QInputDialog>
95 #include <QProgressDialog>
98 #include "vtkClipPolyData.h"
125 m_ImageProcessor(NULL),
126 m_BackgroundColor(Qt::black),
127 m_TraceSettingsToolBar(NULL),
128 m_IntersectionLineWidth(2.),
136 m_MeshEditingWidget(NULL),
188 SIGNAL( ChangeColorCode(
const QString&) ),
190 SLOT( ChangeColorCode(
const QString&) ) );
193 SIGNAL( UpdateTracksRepresentation(
const double&,
const double&,
const double&) ),
195 SLOT( UpdateTracksRepresentation(
const double&,
const double&,
const double&) ) );
202 SIGNAL( ChangeDivisionsColorCode(
const QString&) ),
204 SLOT( ChangeDivisionsColorCode(
const QString&) ) );
212 #if defined ( ENABLEFFMPEG ) || defined ( ENABLEAVI )
213 CreateVideoRecorderWidget();
225 std::pair< QGoDockWidgetStatus *, QDockWidget * >(
231 std::pair< QGoDockWidgetStatus *, QDockWidget * >(
234 Qt::RightDockWidgetArea,
false,
true,
this),
238 std::pair< QGoDockWidgetStatus *, QDockWidget * >(
240 Qt::LeftDockWidgetArea,
false,
true,
this),
245 std::pair< QGoDockWidgetStatus *, QDockWidget * >(
247 Qt::LeftDockWidgetArea,
false,
true,
this),
251 std::pair< QGoDockWidgetStatus *, QDockWidget * >(
253 Qt::TopDockWidgetArea,
false,
true,
this),
256 #if defined ( ENABLEFFMPEG ) || defined ( ENABLEAVI )
258 std::pair< QGoDockWidgetStatus *, QDockWidget * >(
260 m_VideoRecorderWidget) );
283 for(
unsigned int i = minch; i < maxch + 1; i++ )
327 for(
size_t id = 0;
id <
m_Seeds.size();
id++ )
337 std::vector< QString >
343 std::vector< QString > channelNames;
344 channelNames.resize( numberOfChannels );
346 for(
unsigned int i =0; i<numberOfChannels; ++i)
357 int iTimeMin,
int iTimeMax)
367 channelNames, iTimeMin, iTimeMax, &
m_Seeds,
370 this->CreateConnectionsTraceEditingWidget<QGoContourEditingWidgetManager>(
375 SIGNAL( ManualSegmentationActivated(
bool) ),
380 SIGNAL( ContourValidated(
int) ),
384 SIGNAL( reinitializeContour() ),
386 SLOT( ReinitializeContourWidget() ) );
389 SIGNAL( changeContourRepresentationProperty(
float,
QColor,
392 SLOT( UpdateContourRepresentationProperties(
float,
QColor,
396 SIGNAL(TracesCreatedFromAlgo(std::vector<vtkPolyData *>,
int) ),
419 channelNames, iTimeMin, iTimeMax, &
m_Seeds,
422 this->CreateConnectionsTraceEditingWidget<QGoMeshEditingWidgetManager>(
426 SIGNAL(TracesCreatedFromAlgo(std::vector<vtkPolyData *>,
int) ),
431 SIGNAL(TracesSplittedFromAlgo(std::vector<vtkPolyData *>) ),
436 SIGNAL(TracesMergedFromAlgo(vtkPolyData *)),
442 SIGNAL(SetOfContoursFromAlgo(std::vector<std::vector<vtkPolyData*> >,
int) ),
452 SIGNAL(RequestPolydatas() ),
623 SIGNAL( DBVariablesSet() ),
631 SLOT( UpdateSelectedTimePoint(
int) ) );
634 SIGNAL( TraceToReEdit(
unsigned int) ),
638 SIGNAL( NewMeshToGenerate(std::list< unsigned int >,
int) ),
646 SIGNAL( NeedToGoToTheRealLocation(
double,
double,
double,
int) ),
663 SIGNAL( PrintMessage(
QString,
int) ),
665 SLOT( showMessage(
QString,
int) ) );
681 #if defined ( ENABLEFFMPEG ) || defined ( ENABLEAVI )
685 QGoTabImageView3DwT::CreateVideoRecorderWidget()
690 this, SLOT( SetRendererWindow(
int) ) );
707 QGoTabImageView3DwT::SetRendererWindow(
int iValue)
711 m_VideoRecorderWidget->SetRenderingWindow(
716 m_VideoRecorderWidget->SetRenderingWindow(NULL);
740 QIcon::Normal, QIcon::Off);
741 QuadViewAction->
setIcon(quadviewicon);
755 QIcon::Normal, QIcon::Off);
756 FullScreenXYAction->
setIcon(xyicon);
770 QIcon::Normal, QIcon::Off);
771 FullScreenXZAction->
setIcon(xzicon);
785 QIcon::Normal, QIcon::Off);
786 FullScreenYZAction->
setIcon(yzicon);
800 QIcon::Normal, QIcon::Off);
801 FullScreenXYZAction->
setIcon(xyzicon);
814 QAction *ActionDisplayAnnotations =
815 new QAction(
tr(
"Display annotations"),
this);
818 ActionDisplayAnnotations->
setStatusTip(
tr(
" Display annotations in each 2d view") );
820 QIcon displayannotationsicon;
822 QIcon::Normal, QIcon::Off);
823 ActionDisplayAnnotations->
setIcon(displayannotationsicon);
830 QAction *ActionDisplaySplinePlanes =
831 new QAction(
tr(
"Display spline planes"),
this);
834 ActionDisplaySplinePlanes->
setStatusTip(
tr(
" Display spline planes on each view") );
836 QIcon displaysplineplaneicon;
838 QIcon::Normal, QIcon::Off);
839 ActionDisplaySplinePlanes->
setIcon(displaysplineplaneicon);
852 QIcon::Normal, QIcon::Off);
853 DisplayCube3D->
setIcon(cube3dicon);
863 LookupTableAction->
setStatusTip(
tr(
" Change the associated lookup table") );
884 QIcon::Normal, QIcon::Off);
885 ScalarBarAction->
setIcon(scalarbaricon);
911 QAction *Change3DPerspectiveToAxialAction =
912 new QAction(
tr(
"Change 3D view to Posterior "),
this);
915 QIcon::Normal, QIcon::Off);
916 Change3DPerspectiveToAxialAction->
setIcon(axialicon);
922 QAction *Change3DPerspectiveToCoronalAction =
923 new QAction(
tr(
"Change 3D view to Dorsal "),
this);
926 QIcon::Normal, QIcon::Off);
927 Change3DPerspectiveToCoronalAction->
setIcon(coronalicon);
931 QObject::connect( Change3DPerspectiveToCoronalAction, SIGNAL( triggered() ),
934 QAction *Change3DPerspectiveToSagittalAction =
935 new QAction(
tr(
"Change 3D view to Left "),
this);
938 QIcon::Normal, QIcon::Off);
939 Change3DPerspectiveToSagittalAction->
setIcon(sagittalicon);
943 QObject::connect( Change3DPerspectiveToSagittalAction, SIGNAL( triggered() ),
951 QAction *VolumeRenderingAction =
952 new QAction(
tr(
"Enable the volume rendering for the current channel(s)"),
this);
957 QIcon volumerenderingicon;
959 QIcon::Normal, QIcon::Off);
960 VolumeRenderingAction->
setIcon(volumerenderingicon);
966 QAction *SynchronizeViewsAction =
967 new QAction(
tr(
"synchronize the different views"),
this);
972 QIcon synchronizeicon;
974 QIcon::Normal, QIcon::Off);
975 SynchronizeViewsAction->
setIcon(synchronizeicon);
978 this->
m_ImageView, SLOT( SynchronizeViews(
bool) ) );
981 QAction *PlaneVisibilityAction =
982 new QAction(
tr(
"show planes in the 3d view"),
this);
987 QIcon PlaneVisibilityicon;
989 QIcon::Normal, QIcon::Off);
990 PlaneVisibilityAction->
setIcon(PlaneVisibilityicon);
1017 for(
unsigned int i = boundChannel[0]; i < boundChannel[1]+1; ++i )
1024 tr(
"Channel selection"),
1025 tr(
"Please select the channel you want to track"),
1026 channel, 0,
false, &ok);
1031 item.
toInt(&ok, 10));
1072 #if defined( ENABLEFFMPEG ) || defined( ENABLEAVI )
1073 this->
m_ToolsActions.push_back( m_VideoRecorderWidget->toggleViewAction() );
1074 this->m_VideoRecorderWidget->toggleViewAction()->setEnabled(
false);
1080 QIcon::Normal, QIcon::Off);
1100 QAction *DeleteBookmarkAction =
new QAction(
tr(
"Delete a bookmark"),
this);
1119 tr(
"Import the data of the contours from the text file into the GoFigure database" ) );
1122 tr(
"Import the data of the meshes from the text file into the GoFigure database" ) );
1125 tr(
"Import the data of the tracks from the text file into the GoFigure database" ) );
1127 ImportMenu->
addAction(ImportContoursAction);
1128 ImportMenu->
addAction(ImportMeshesAction);
1129 ImportMenu->
addAction(ImportTracksAction);
1134 tr(
"Export all the data related to all contours of the imagingsession from the database into a .txt file") );
1138 tr(
"Export all the data related to all meshes of the imagingsession from the database into a .txt file") );
1140 QAction *ExportLineagesAction =
new QAction(
tr(
"Lineages For Lineage Viewer"),
this);
1142 tr(
"Export each lineage into a vtkFile in order to be visualized separately into the lineage viewer outside of Gofigure") );
1144 ExportMenu->
addAction(ExportContoursAction);
1145 ExportMenu->
addAction(ExportMeshesAction);
1146 ExportMenu->
addAction(ExportLineagesAction);
1163 SIGNAL( ExportLineages() ) );
1171 bool UpdateOpenBookmarks =
false;
1178 UpdateOpenBookmarks =
true;
1182 size_t NumberBookmarks = ListBookmarks.size();
1184 QMenu *OpenBookmarkMenu =
new QMenu(
tr(
"Open a bookmark"),
this);
1186 for (
size_t i = 0; i < NumberBookmarks; i++ )
1188 QAction *OpenBookmarkAction =
new QAction(ListBookmarks[i].first.c_str(),
this);
1190 std::string TextStatusTip =
"Description of the bookmark: ";
1192 TextStatusTip += ListBookmarks[i].second;
1194 OpenBookmarkAction->
setStatusTip( TextStatusTip.c_str() );
1196 OpenBookmarkMenu->
addAction(OpenBookmarkAction);
1199 OpenBookmarkAction, SIGNAL( triggered() ),
1206 if ( UpdateOpenBookmarks )
1218 std::string BookmarkName = taction->
text().toStdString();
1245 switch ( FullScreenView )
1248 filename.
append(
"snapshot-xy-");
1253 filename.
append(
"snapshot-xz-");
1258 filename.
append(
"snapshot-yz-");
1263 filename.
append(
"snapshot-xyz-");
1277 iParent->
resize(800, 800);
1365 const std::string & iHeader,
1366 const unsigned int & iTimePoint)
1414 for(
unsigned int i = 0; i < NumberOfChannels; i++ )
1451 std::pair< QGoDockWidgetStatus *, QDockWidget * >(
1454 Qt::LeftDockWidgetArea,
false,
true,
this),
1458 std::pair< QGoDockWidgetStatus *, QDockWidget * >(
1461 Qt::LeftDockWidgetArea,
false,
true,
this),
1465 #if defined( ENABLEFFMPEG ) || defined( ENABLEAVI )
1466 m_VideoRecorderWidget->SetXMinAndMax(extent[0], extent[1]);
1467 m_VideoRecorderWidget->SetYMinAndMax(extent[2], extent[3]);
1468 m_VideoRecorderWidget->SetZMinAndMax(extent[4], extent[5]);
1469 m_VideoRecorderWidget->SetTMinAndMax(boundTime[0], boundTime[1]);
1481 if ( NumberOfVisibleChannels>1 )
1485 else if( NumberOfVisibleChannels == 1)
1492 this->findChild<QAction*>(
"LUT")->
setEnabled(
true);
1493 this->findChild<QAction*>(
"ScalarBar")->
setEnabled(
true);
1498 vtkSmartPointer<vtkLookupTable> bwLut =
1499 vtkSmartPointer<vtkLookupTable>::New();
1500 bwLut->SetTableRange (0, 1);
1501 bwLut->SetSaturationRange (0, 0);
1502 bwLut->SetHueRange (0, 0);
1503 bwLut->SetValueRange (0, 0);
1600 std::list<unsigned int> timePoints =
1602 UpdateTableWidgetAndContainersForGivenTimePoint(
1728 #if defined ( ENABLEFFMPEG ) || defined ( ENABLEAVI )
1729 this->m_VideoRecorderWidget->toggleViewAction()->setEnabled(
false);
1741 #if defined ( ENABLEFFMPEG ) || defined ( ENABLEAVI )
1742 this->m_VideoRecorderWidget->toggleViewAction()->setEnabled(
true);
1754 #if defined ( ENABLEFFMPEG ) || defined ( ENABLEAVI )
1755 this->m_VideoRecorderWidget->toggleViewAction()->setEnabled(
true);
1767 #if defined ( ENABLEFFMPEG ) || defined ( ENABLEAVI )
1768 this->m_VideoRecorderWidget->toggleViewAction()->setEnabled(
true);
1780 #if defined ( ENABLEFFMPEG ) || defined ( ENABLEAVI )
1781 this->m_VideoRecorderWidget->toggleViewAction()->setEnabled(
true);
1791 double r(0.), g(0.), b(0.);
1812 double r(0.), g(0.), b(0.);
1818 this,
tr(
"Choose Background Color") );
1838 if ( iChannel == 1 )
1855 for (
unsigned int i = 0; i < NumberOfChannels; i++ )
1903 if ( ( contour->GetNumberOfPoints() > 2 ) && ( iTCoord >= 0 ) )
1925 std::vector< int > boundingBox(6, 0);
1931 iElement->GetBounds(bounds);
1934 double Min[3], Max[3];
1937 for( i = 0; i < 3; i++ )
1939 Min[i] = bounds[k++];
1940 Max[i] = bounds[k++];
1949 for( i = 0; i < 3; i++ )
1951 if ( min_idx[i] > extent[2 * i] )
1953 boundingBox[2 * i] = min_idx[i];
1957 boundingBox[2 * i] = extent[2 * i];
1959 if ( max_idx[i] < extent[2 * i + 1] )
1961 boundingBox[2 * i + 1] = max_idx[i];
1965 boundingBox[2 * i + 1] = extent[2 * i + 1];
1978 std::vector< vtkActor * >
1981 std::vector< vtkActor * > oActors;
1983 if ( iTrace->GetNumberOfPoints() > 2 )
1985 vtkProperty *trace_property = vtkProperty::New();
1986 trace_property->SetColor(iRGBA[0], iRGBA[1], iRGBA[2]);
1987 trace_property->SetOpacity(iRGBA[3]);
1989 vtkPolyData *trace_copy = vtkPolyData::New();
1990 trace_copy->DeepCopy(iTrace);
1993 this->
AddContour(trace_copy, trace_property);
1995 trace_copy->Delete();
1996 trace_property->Delete();
2022 if ( nodes->GetNumberOfPoints() > 2 )
2026 vtkPolyData *contour = vtkPolyData::New();
2036 std::vector< vtkActor * > actors =
2076 std::vector< vtkActor * >
2088 vtkPolyData *nodes = NULL;
2091 ->RemoveElementFromVisualizationWithGivenTraceID(iId) )
2097 int dir = ContourMeshContainer::ComputeDirectionFromBounds< int >(bounds);
2102 idx[0] = ( bounds[0] + bounds[1] ) / 2;
2103 idx[1] = ( bounds[2] + bounds[3] ) / 2;
2104 idx[2] = ( bounds[4] + bounds[5] ) / 2;
2109 QAction* action = this->findChild< QAction* >(
"ContourEditingMode");
2131 if( temp_actor->GetMapper()->GetInput()->GetFieldData()->GetArray(
"MESH") )
2134 temp_actor->GetMapper()->GetInput()->GetFieldData()->GetArray(
"MESH")->GetTuple1(0));
2138 if( temp_actor->GetMapper()->GetInput()->GetFieldData()->GetArray(
"TRACK") )
2141 temp_actor->GetMapper()->GetInput()->GetFieldData()->GetArray(
"TRACK")->GetTuple1(0));
2145 if( temp_actor->GetMapper()->GetInput()->GetFieldData()->GetArray(
"DIVISION") )
2148 temp_actor->GetMapper()->GetInput()->GetFieldData()->GetArray(
"DIVISION")->GetTuple1(0));
2152 if( temp_actor->GetMapper()->GetInput()->GetFieldData()->GetArray(
"CONTOUR") )
2155 temp_actor->GetMapper()->GetInput()->GetFieldData()->GetArray(
"CONTOUR")->GetTuple1(0));
2168 if( temp_actor->GetMapper()->GetInput()->GetFieldData()->GetArray(
"MESH") )
2171 temp_actor->GetMapper()->GetInput()->GetFieldData()->GetArray(
"MESH")->GetTuple1(0),
2176 if( temp_actor->GetMapper()->GetInput()->GetFieldData()->GetArray(
"TRACK") )
2179 temp_actor->GetMapper()->GetInput()->GetFieldData()->GetArray(
"TRACK")->GetTuple1(0),
2184 if( temp_actor->GetMapper()->GetInput()->GetFieldData()->GetArray(
"CONTOUR") )
2187 temp_actor->GetMapper()->GetInput()->GetFieldData()->GetArray(
"CONTOUR")->GetTuple1(0),
2279 #if defined ( ENABLEFFMPEG ) || defined ( ENABLEAVI )
2283 m_VideoRecorderWidget->SetCurrentT( this->
GetTimePoint() );
2295 std::cerr <<
"Problem with DB" << std::endl;
2302 std::cerr <<
"Input contour is NULL" << std::endl;
2307 if ( iView->GetNumberOfPoints() == 0 )
2309 std::cerr <<
"No points in the contour you want to save" << std::endl;
2313 vtkPolyData *contour_nodes = vtkPolyData::New();
2322 std::vector< vtkActor * > actors =
2349 vtkOrientedGlyphContourRepresentation *contourRep =
2350 vtkOrientedGlyphContourRepresentation::New();
2352 vtkContourWidget *contourWidget = vtkContourWidget::New();
2356 contourWidget->SetRepresentation(contourRep);
2357 contourWidget->On();
2359 contourWidget->Initialize(iView);
2360 contourWidget->CloseLoop();
2362 contourRep->GetNodePolyData(contour_nodes);
2364 contourWidget->Delete();
2365 contourRep->Delete();
2383 bounds[1], bounds[3], bounds[5],
2395 std::vector<vtkPolyData *> iVectPolydata,
int iTCoord)
2397 std::vector<vtkPolyData *>::iterator iter = iVectPolydata.begin();
2398 while(iter != iVectPolydata.end())
2411 std::vector<vtkPolyData *> iVectPolydata)
2413 int N =
static_cast< int >( iVectPolydata.size() );
2421 std::list< unsigned int > traceID =
2424 std::list< unsigned int > collectionID =
2427 std::list< unsigned int > tCoord =
2434 unsigned int timePoint = tCoord.front();
2444 for(
int i = 1; i < N; ++i )
2457 vtkPolyData * iVectPolydata)
2459 if( iVectPolydata == NULL )
2463 std::list< unsigned int > traceID =
2466 std::list< unsigned int > collectionID =
2469 std::list< unsigned int > tCoord =
2473 std::list< unsigned int >::iterator iterator = traceID.begin();
2474 while(iterator != traceID.end())
2491 std::vector<std::vector<vtkPolyData*> > iVectorSetOfContours,
int iTCoord)
2494 std::vector<std::vector<vtkPolyData*> >::iterator it1 =
2495 iVectorSetOfContours.begin();
2496 while(it1!=iVectorSetOfContours.end())
2498 std::vector<vtkPolyData*>::iterator it2 = (*it1).begin();
2499 while(it2!=(*it1).end())
2501 vtkPolyData* data = vtkPolyData::New();
2502 data->DeepCopy(*it2);
2512 std::vector<vtkPolyData *> iVectPolydata,
int iTCoord)
2514 std::vector<vtkPolyData *>::iterator iter = iVectPolydata.begin();
2515 while(iter != iVectPolydata.end())
2528 unsigned int iTCoord,
2533 std::cerr <<
"Input Mesh is NULL" << std::endl;
2537 SaveMesh(iView, iTCoord, iCollectionID);
2544 std::vector< vtkActor * > actors =
2565 std::cerr <<
"Problem with DB" << std::endl;
2569 vtkPolyData *contour_nodes = vtkPolyData::New();
2573 if ( ( iInput->GetNumberOfPoints() > 2 ) && (
m_TCoord >= 0 ) )
2591 std::vector< vtkActor * > actors =
2618 this->findChild< QAction* >(
"DefaultMode")->setChecked(
true);
2628 const bool & iIntensity,
2629 const unsigned int& iTCoord )
2631 typedef unsigned char PixelType;
2632 const unsigned int Dimension = 3;
2633 typedef itk::Image< PixelType, Dimension > ImageType;
2650 for(
int i = 0; i < NumberOfChannels; i++ )
2652 vtkSmartPointer< vtkImageExport > vtk_exporter =
2653 vtkSmartPointer< vtkImageExport >::New();
2654 itk::VTKImageImport< ImageType >::Pointer itk_importer =
2655 itk::VTKImageImport< ImageType >::New();
2659 ConnectPipelines< vtkImageExport, itk::VTKImageImport< ImageType >::Pointer >(
2660 vtk_exporter, itk_importer);
2661 calculator->
SetImage( itk_importer->GetOutput() );
2678 vtkSmartPointer< vtkImageExport > vtk_exporter =
2679 vtkSmartPointer< vtkImageExport >::New();
2680 itk::VTKImageImport< ImageType >::Pointer itk_importer =
2681 itk::VTKImageImport< ImageType >::New();
2685 ConnectPipelines< vtkImageExport, itk::VTKImageImport< ImageType >::Pointer >(
2686 vtk_exporter, itk_importer);
2687 calculator->
SetImage( itk_importer->GetOutput() );
2700 std::vector< vtkSmartPointer< vtkImageData > > temp_image( NumberOfChannels );
2709 #pragma omp parallel for
2711 for(
int i = static_cast< int >( boundChannel[0] );
2712 i <= static_cast< int >( boundChannel[1] );
2717 vtkSmartPointer< vtkImageExport > vtk_exporter =
2718 vtkSmartPointer< vtkImageExport >::New();
2719 itk::VTKImageImport< ImageType >::Pointer itk_importer =
2720 itk::VTKImageImport< ImageType >::New();
2722 vtk_exporter->SetInput(temp_image[i]);
2724 ConnectPipelines< vtkImageExport, itk::VTKImageImport< ImageType >::Pointer >(
2725 vtk_exporter, itk_importer);
2726 calculator->
SetImage( itk_importer->GetOutput() );
2745 vtkSmartPointer< vtkImageExport > vtk_exporter =
2746 vtkSmartPointer< vtkImageExport >::New();
2747 itk::VTKImageImport< ImageType >::Pointer itk_importer =
2748 itk::VTKImageImport< ImageType >::New();
2750 vtk_exporter->SetInput(temp_image[0]);
2752 ConnectPipelines< vtkImageExport, itk::VTKImageImport< ImageType >::Pointer >(
2753 vtk_exporter, itk_importer);
2754 calculator->
SetImage( itk_importer->GetOutput() );
2786 std::list< unsigned int > iListContourIDs,
2790 std::list< unsigned int >::const_iterator contourid_it = iListContourIDs.begin();
2791 std::list< unsigned int >::const_iterator contourid_end = iListContourIDs.end();
2793 std::vector< vtkPolyData * > list_contours;
2796 unsigned int tcoord = std::numeric_limits< unsigned int >::max();
2798 while ( contourid_it != contourid_end )
2802 boost::tuples::tie(it0, it1) =
2807 if ( tcoord == std::numeric_limits< unsigned int >::max() )
2809 tcoord = it0->TCoord;
2813 if ( it0->TCoord != tcoord )
2817 tr(
"Generate Mesh From Checked Contours"),
2818 tr(
"Selected contours are at different time point: %1 != %2").arg(tcoord).arg( it0->TCoord) );
2823 list_contours.push_back(
2824 vtkPolyData::SafeDownCast(
2825 it0->ActorXYZ->GetMapper()->GetInput() ) );
2830 if ( !list_contours.empty() )
2834 FilterType::Pointer filter = FilterType::New();
2835 filter->ProcessContours(list_contours);
2837 vtkPolyData *mesh = filter->GetOutput();
2839 vtkBox *implicitFunction = vtkBox::New();
2843 vtkClipPolyData *cutter = vtkClipPolyData::New();
2844 cutter->SetInput(mesh);
2845 cutter->InsideOutOn();
2846 cutter->SetClipFunction(implicitFunction);
2849 vtkPolyData *temp = vtkPolyData::New();
2850 temp->DeepCopy( cutter->GetOutput() );
2853 implicitFunction->Delete();
2883 std::vector< int > NewTrackIDs =
2927 vtkSmartPointer<vtkIntArray> trackIDArray = vtkSmartPointer<vtkIntArray>::New();
2928 trackIDArray->SetNumberOfComponents(1);
2929 trackIDArray->SetNumberOfValues(1);
2930 trackIDArray->SetName(iTrace);
2931 trackIDArray->SetValue(0, iTraceID);
2933 iPolydata->GetFieldData()->AddArray(trackIDArray);
2978 new QGoToolBarStatus(iToolBar, iMenu, Qt::TopToolBarArea,
true,
true,
this);
2980 QActionGroup* group = this->findChild< QActionGroup* >(
"ModeGroup");
2983 QAction *ContourSegmentationAction =
2985 ContourSegmentationAction->
setShortcut(
tr(
"2",
"Contour Editing Mode"));
2986 ContourSegmentationAction->setParent(
this);
2987 ContourSegmentationAction->setObjectName(
"ContourEditingMode");
2989 group->
addAction(ContourSegmentationAction);
2992 TracesToolBar->
m_VectorAction.push_back(ContourSegmentationAction);
2996 QAction *MeshSegmentationAction =
2998 MeshSegmentationAction->
setShortcut(
tr(
"3",
"Mesh Editing Mode"));
3000 group->
addAction(MeshSegmentationAction);
3017 SIGNAL( toggled(
bool) ),
3019 SLOT( SetVisible(
bool) ) );
3022 SIGNAL( toggled(
bool) ),
3027 SIGNAL( toggled(
bool) ),
3029 SLOT( SetVisible(
bool) ) );
3032 SIGNAL( toggled(
bool) ),
3046 iToolBar, 0, Qt::TopToolBarArea,
false,
true,
this,
3067 std::vector<int> dopplerT =
3072 if (dopplerT[i] >= 0 )
3074 double* rgb = vtkMath::HSVToRGB(
3075 static_cast<double>(i) /
3076 static_cast<double>(
3078 QColor color(rgb[0]*255, rgb[1]*255, rgb[2]*255);
3079 ListTimePoints[
tr(
"%1").
arg(dopplerT[i])] = color;
3098 QActionGroup* group = this->findChild<QActionGroup*>(
"ModeGroup");
3100 separator1->setSeparator(
true);
3107 ActorPickingAction->
setShortcut(
tr(
"P",
"Object Picking Mode"));
3111 QIcon ActorPickingIcon;
3113 QIcon::Normal, QIcon::Off);
3114 ActorPickingAction->
setIcon(ActorPickingIcon);
3116 "Select a contour or a mesh (left click when the bounding box of the object of interest is visible)") );
3128 QAction *Box3DPickingAction =
new QAction(
tr(
"Show/hide objects using Box"),
this);
3129 Box3DPickingAction->
setShortcut(
tr(
"B",
"Box Widget Mode"));
3133 QIcon Box3DPickingIcon;
3135 QIcon::Normal, QIcon::Off);
3136 Box3DPickingAction->
setIcon(Box3DPickingIcon);
3137 Box3DPickingAction->
setStatusTip(
tr(
"Show only the objects in the box") );
3149 QAction *PlaneWidgetAction =
new QAction(
tr(
"Show/hide objects using Plane"),
this);
3153 QIcon PlaneWidgetIcon;
3155 QIcon::Normal, QIcon::Off);
3156 PlaneWidgetAction->
setIcon(PlaneWidgetIcon);
3157 PlaneWidgetAction->
setStatusTip(
tr(
"Show only the objects located in front of the plane") );
3181 QIcon::Normal, QIcon::Off);
3182 DistanceAction->
setIcon(DistanceIcon);
3183 DistanceAction->
setStatusTip(
tr(
"Measure a distance between 2 points (left click to place/drag the points)") );
3203 QIcon::Normal, QIcon::Off);
3204 AngleAction->
setIcon(AngleIcon);
3205 AngleAction->
setStatusTip(
tr(
"Measure an angle between 3 points (left click to place/drag the points)") );
3277 SIGNAL( updateVisualization() ),
3282 SIGNAL( UpdateImageStructure(
QString,
3283 std::map< unsigned int, unsigned int>,
3290 std::map< unsigned int, unsigned int>,
3338 std::map< unsigned int, unsigned int> iPoints,
3348 std::vector<double> color;
3349 color.push_back(iColor.
redF()*255);
3350 color.push_back(iColor.
greenF()*255);
3351 color.push_back(iColor.
blueF()*255);
3394 for(
unsigned int i = time[0]; i<time[1]+1; i++)
3409 typedef ContourContainer::MultiIndexContainerType::index< TCoord >::type::iterator
3410 ContourContainerTCoordIterator;
3415 if ( !iTPointToLoad.empty() )
3417 std::list<unsigned int>::const_iterator it = iTPointToLoad.begin();
3418 std::list<unsigned int>::const_iterator end = iTPointToLoad.end();
3422 ContourContainerTCoordIterator it0, it1;
3424 boost::tuples::tie(it0, it1)
3429 while ( it0 != it1 )
3431 this->AddContourFromNodes< TCoord >( it0 );
3453 for(
unsigned int i = time[0]; i<time[1]+1; i++)
3468 typedef MeshContainer::MultiIndexContainerType::index< TCoord >::type::iterator
3469 MeshContainerTCoordIterator;
3472 std::stringstream lastTimePoint;
3473 lastTimePoint << lastTP;
3478 if ( !iTPointToLoad.empty() )
3480 std::list<unsigned int>::const_iterator it = iTPointToLoad.begin();
3481 std::list<unsigned int>::const_iterator end = iTPointToLoad.end();
3485 MeshContainerTCoordIterator it0, it1;
3487 boost::tuples::tie(it0, it1) =
3492 GetNumberOfElementForTraceAndTimePoint(
"mesh", *it);
3493 std::stringstream time;
3503 std::vector< MeshContainerTCoordIterator > tempvector;
3506 tempvector.push_back(it0);
3510 int numberOfMeshes =
static_cast< int >( tempvector.size() );
3519 for(
int i = 0; i < numberOfMeshes; i++ )
3521 it0 = tempvector[i];
3533 &attributes, it0->TraceID);
3535 this->AddMeshFromNodes< TCoord >( it0 );
3539 progress.setValue( i );
3542 progress.setValue(size);
3592 for(
int i = 0; i < NumberOfChannels; i++ )
3617 std::list< vtkPolyData* > elements = this->
m_MeshContainer-> GetHighlightedElements();
3629 tr(
"Ctrl+C",
"Next Time Point")),
3633 tr(
"Right Arrow",
"Next Time Point")),
3639 tr(
"Ctrl+Z",
"Previous Time Point")),
3643 tr(
"Left Arrow",
"Next Time Point")),
3679 for(
int i=0; i < N; ++i)