Example #1
0
mitk::WiiMoteInteractor::WiiMoteInteractor(const char* type, DataNode* dataNode)
: Interactor(type, dataNode)
, m_OrientationX(0)
, m_OrientationY(0)
, m_OrientationZ(0)
, m_xVelocity (0)
, m_yVelocity (0)
, m_zVelocity (0)
, m_xAngle (0)
, m_yAngle (0)
, m_zAngle (0)
, m_xValue (0)
, m_yValue (0)
, m_zValue (0)
, m_InRotation(false)
, m_TranslationMode(1)
, m_OriginalGeometry(NULL)
, m_SurfaceInteractionMode(1)
{
  // save original geometry
  mitk::Geometry3D* temp = this->TransformCurrentDataInGeometry3D();
  try
  {
    m_OriginalGeometry = dynamic_cast<mitk::Geometry3D*>(temp->Clone().GetPointer());
  }
  catch(...)
  {
    MITK_WARN << "Original geometry could not be stored!";
  }

  // connect actions to methods
  CONNECT_ACTION(mitk::AcONWIIMOTEINPUT,OnWiiMoteInput);
  CONNECT_ACTION(mitk::AcONWIIMOTEBUTTONRELEASED,OnWiiMoteReleaseButton);
  CONNECT_ACTION(mitk::AcRESETVIEW,OnWiiMoteResetButton);
}
mitk::SpaceNavigatorVtkCameraController::SpaceNavigatorVtkCameraController()
: CameraController("SpaceNavigatorInteraction")
{
  //connect method this->OnSpaceNavigatorEvent to StateMachineEventMechanism
  CONNECT_ACTION(AcONSPACENAVIGATORMOUSEINPUT, OnSpaceNavigatorEvent);
  CONNECT_ACTION(AcONPACENAVIGATORKEYDOWN, OnSpaceNavigatorKeyDown);
  m_ClippingRangeIsSet = false;
}
Example #3
0
SlicesRotator::SlicesRotator(const char* machine)
    : SlicesCoordinator(machine)
{
    // make sure that AcSWITCHON and AcSWITCHOFF are defined int constants somewhere (e.g. mitkInteractionConst.h)
    CONNECT_ACTION( AcMOVE, DoSelectSlice );
    CONNECT_ACTION( AcCHECKPOINT, DoDecideBetweenRotationAndSliceSelection );
    CONNECT_ACTION( AcROTATESTART, DoStartRotation );
    CONNECT_ACTION( AcROTATE, DoRotationStep );
    CONNECT_ACTION( AcROTATEEND, DoEndRotation );
}
Example #4
0
mitk::CorrectorTool2D::CorrectorTool2D(int paintingPixelValue)
:FeedbackContourTool("PressMoveRelease"),
 m_PaintingPixelValue(paintingPixelValue)
{
  // great magic numbers
  CONNECT_ACTION( 80, OnMousePressed );
  CONNECT_ACTION( 90, OnMouseMoved );
  CONNECT_ACTION( 42, OnMouseReleased );

  GetFeedbackContour()->SetClosed( false ); // don't close the contour to a polygon
}
mitk::TDMouseVtkCameraController::TDMouseVtkCameraController() 
: CameraController("TDMouseInteraction")
{
  //activate and instanciate EventThrower
  mitk::TDMouseEventThrower* thrower = mitk::TDMouseEventThrower::GetInstance();
  //add this to GlobalInteracion to listen to events
  mitk::GlobalInteraction::GetInstance()->AddListener(this);
  //connect method this->OnTDMouseEvent to StateMachineEventMechanism
  CONNECT_ACTION(AcONTDMOUSEINPUT, OnTDMouseEvent);
  CONNECT_ACTION(AcONTDMOUSEKEYDOWN, OnTDMouseKeyDown);
  m_ClippingRangeIsSet = false;
}
Example #6
0
mitk::SetRegionTool::SetRegionTool(int paintingPixelValue)
:FeedbackContourTool("PressMoveReleaseWithCTRLInversion"),
 m_PaintingPixelValue(paintingPixelValue),
 m_FillContour(false),
 m_StatusFillWholeSlice(false)
{
  // great magic numbers
  CONNECT_ACTION( 80, OnMousePressed );
  //CONNECT_ACTION( 90, OnMouseMoved );
  CONNECT_ACTION( 42, OnMouseReleased );
  CONNECT_ACTION( 49014, OnInvertLogic );

}
Example #7
0
mitk::RegionGrow3DTool::RegionGrow3DTool(): Tool("PressMoveRelease"),
    m_LowerThreshold(-5000),
    m_UpperThreshold(5000),
    m_CurrentRGDirectionIsUpwards(false)
{

    CONNECT_ACTION( 42, OnMouseReleased );

    this->SupportRoiOn();

    m_FeedbackNode = DataNode::New();
    m_FeedbackNode->SetProperty( "color", ColorProperty::New(1.0, 0.0, 0.0) );
    m_FeedbackNode->SetProperty( "texture interpolation", BoolProperty::New(false) );
    m_FeedbackNode->SetProperty( "layer", IntProperty::New( 100 ) );
    m_FeedbackNode->SetProperty( "levelwindow", LevelWindowProperty::New( LevelWindow(100, 1) ) );
    m_FeedbackNode->SetProperty( "name", StringProperty::New("failsafe region grow feedback") );
    m_FeedbackNode->SetProperty( "opacity", FloatProperty::New(0.3) );
    m_FeedbackNode->SetProperty( "helper object", BoolProperty::New(true) );
    m_FeedbackNode->SetVisibility(false);

    m_PointSetNode = mitk::DataNode::New();
    m_PointSetNode->SetName("regiongrow3d pointset");
    m_PointSetNode->SetProperty("helper object", mitk::BoolProperty::New(true));
    m_PointSetNode->SetProperty("layer", mitk::IntProperty::New(2));

    mitk::PointSet::Pointer pointSet = mitk::PointSet::New();
    m_PointSetNode->SetData(pointSet);
}
Example #8
0
mitk::FastMarchingTool::FastMarchingTool()
:FeedbackContourTool("PressMoveReleaseAndPointSetting"),
m_NeedUpdate(true),
m_CurrentTimeStep(0),
m_LowerThreshold(0),
m_UpperThreshold(200),
m_StoppingValue(100),
m_Sigma(1.0),
m_Alpha(-0.5),
m_Beta(3.0),
m_PositionEvent(0)
{
  CONNECT_ACTION( AcADDPOINTRMB, OnAddPoint );
  CONNECT_ACTION( AcADDPOINT, OnAddPoint );
  CONNECT_ACTION( AcREMOVEPOINT, OnDelete );
}
Example #9
0
mitk::RegionGrowingTool::RegionGrowingTool()
:FeedbackContourTool("PressMoveRelease"),
 m_LowerThreshold(200),
 m_UpperThreshold(200),
 m_InitialLowerThreshold(200),
 m_InitialUpperThreshold(200),
 m_ScreenYDifference(0),
 m_OriginalPicSlice(NULL),
 m_SeedPointMemoryOffset(0),
 m_VisibleWindow(0),
 m_DefaultWindow(0),
 m_MouseDistanceScaleFactor(0.5),
 m_LastWorkingSeed(-1),
 m_FillFeedbackContour(true)
{
  // great magic numbers
  CONNECT_ACTION( 80, OnMousePressed );
  CONNECT_ACTION( 90, OnMouseMoved );
  CONNECT_ACTION( 42, OnMouseReleased );

}
mitk::SurfaceRefinementTool::SurfaceRefinementTool()
:Tool("PositionTracker")
{
	// great magic numbers
	CONNECT_ACTION( 92, OnMouseMoved );

	m_Ext = new mitk::ToolExtension();
	m_Ext->InitTool();

	m_SurfaceHadBeenHit = false;
	m_SubdivisionMethode = 0; // linear subdivision
	m_SubdivisionMethodeROI = 0; // by point
}
Example #11
0
mitk::BulgeTool::BulgeTool()
//:Tool("PositionTracker")
:Tool("MyPositionTrackerWithLeftDrag")
{
	// great magic numbers
	CONNECT_ACTION( 92, OnMouseMoved );
	CONNECT_ACTION( 1003, OnMouseDrag );
	CONNECT_ACTION( 1004, OnMouseLeftClick );
	CONNECT_ACTION( 1005, OnMouseLeftClickRelease );

	m_Ext = new mitk::ToolExtension();
	m_Ext->InitTool();
	
	m_SurfaceHadBeenHit = false;
	m_RadialDirection = false;
	m_ShowBall = true;
	m_SurfaceChanged = false;

	m_RefinementTechnique = 0;

	m_OldVoidCenterVectorIndex = 0;
	m_MouseMovementVectorSumLength = 1;
	m_OldVOICenterVector = new double [3];
	m_OldVOICenterVectors = new double [m_MouseMovementVectorSumLength*3];
	for(int i = 0; i < m_MouseMovementVectorSumLength; i++)
	{
		m_OldVOICenterVectors[i*3] = 0.0;
		m_OldVOICenterVectors[i*3+1] = 0.0;
		m_OldVOICenterVectors[i*3+2] = 0.0;
	}

	// umso groesser desto eher insert points und umso weniger by edge
	m_AutoInsertPointThreshold = 1.5;
	// compare length: 3 side length of the triangle to the radius*m_RadiusThresholdFactor
 	m_RadiusTresholdFactor = 0.5;
}
mitk::RegistrationTool::RegistrationTool()
:Tool("MySelectAndMoveObjectWithArrowKeys")
{
	// great magic numbers
	CONNECT_ACTION( 92, Move );

	m_Ext = new mitk::ToolExtension();
	m_Ext->InitTool();
	m_Ext->SetCalcIntersection(false);	
	m_MoveSurfaceSpeed = 1;

	this->EnableUndo(true);
	//this->EnableUndo(false);
	
	m_AutoReinit = false;
	m_Factor = 1.0;
	m_LastTool = -1;

	mitk::UndoModel* model = m_UndoController->GetCurrentUndoModel();
	//model->Print(std::cout);
}
Example #13
0
PhotoView::Actions::Actions( PhotoView * photoView ):
    _photoView( photoView )
{
    //
    // Zoom
    //

    noZoom = createAction( tr( "No Zoom (100% / &1:1)" ), Qt::Key_1, NoZoom );
    CONNECT_ACTION( noZoom, photoView, setZoomMode() );

    zoomIn = createAction( tr( "Zoom In (Enlarge)" ), Qt::Key_Plus );
    CONNECT_ACTION( zoomIn, photoView, zoomIn() );

    zoomOut = createAction( tr( "Zoom Out (Shrink)" ), Qt::Key_Minus );
    CONNECT_ACTION( zoomOut, photoView, zoomOut() );

    zoomFitImage = createAction( tr( "Zoom to &Fit Window" ), Qt::Key_F, ZoomFitImage );
    addShortcut( zoomFitImage, Qt::Key_M );
    CONNECT_ACTION( zoomFitImage, photoView, setZoomMode() );

    zoomFitWidth = createAction( tr( "Zoom to Fit Window &Width" ), Qt::Key_W, ZoomFitWidth );
    CONNECT_ACTION( zoomFitWidth, photoView, setZoomMode() );

    zoomFitHeight = createAction( tr( "Zoom to Fit Window &Height" ), Qt::Key_H, ZoomFitHeight );
    CONNECT_ACTION( zoomFitHeight, photoView, setZoomMode() );

    zoomFitBest = createAction( tr( "&Best Zoom for Window Width or Height" ), Qt::Key_B, ZoomFitBest );
    CONNECT_ACTION( zoomFitBest, photoView, setZoomMode() );

    //
    // Navigation
    //

    loadNext = createAction( tr( "Load &Next Image" ), Qt::Key_Space, NavigateNext );
    addShortcut( loadNext, Qt::Key_PageDown );
    CONNECT_ACTION( loadNext, photoView, navigate() );

    loadPrevious = createAction( tr( "Load &Previous Image" ), Qt::Key_Backspace, NavigatePrevious );
    addShortcut( loadPrevious, Qt::Key_PageUp );
    CONNECT_ACTION( loadPrevious, photoView, navigate() );

    loadFirst = createAction( tr( "Load &First Image" ), Qt::Key_Home, NavigateFirst );
    CONNECT_ACTION( loadFirst, photoView, navigate() );

    loadLast = createAction( tr( "Load &Last Image" ), Qt::Key_End, NavigateLast );
    CONNECT_ACTION( loadLast, photoView, navigate() );


    //
    // Misc
    //

    forceReload = createAction( tr( "Force &Reload" ), Qt::Key_F5 );
    CONNECT_ACTION( forceReload, photoView, forceReload() );

    toggleFullscreen = createAction( tr( "Toggle F&ullscreen" ), Qt::Key_Return );
    CONNECT_ACTION( toggleFullscreen, photoView, toggleFullscreen() );

    quit = createAction( tr ( "&Quit" ), Qt::Key_Q );
    addShortcut( quit, Qt::Key_Escape );
    CONNECT_ACTION( quit, qApp, quit() );
}