diff --git a/BlueBerry/Bundles/org.blueberry.ui.qt/files.cmake.user b/BlueBerry/Bundles/org.blueberry.ui.qt/files.cmake.user new file mode 100644 index 0000000000..d698c9843a --- /dev/null +++ b/BlueBerry/Bundles/org.blueberry.ui.qt/files.cmake.user @@ -0,0 +1,63 @@ + + + + + + ProjectExplorer.Project.ActiveTarget + -1 + + + ProjectExplorer.Project.EditorSettings + + true + false + true + + Cpp + + CppGlobal + + + + QmlJS + + QmlJSGlobal + + + 2 + UTF-8 + false + 4 + false + true + 1 + true + 0 + true + 0 + 8 + true + 1 + true + true + true + true + + + + ProjectExplorer.Project.PluginSettings + + + + ProjectExplorer.Project.TargetCount + 0 + + + ProjectExplorer.Project.Updater.EnvironmentId + {3dea2ab9-fb51-4719-a902-a8416c2a1947} + + + ProjectExplorer.Project.Updater.FileVersion + 15 + + diff --git a/Core/Code/DataManagement/mitkDisplayGeometry.cpp b/Core/Code/DataManagement/mitkDisplayGeometry.cpp index 7ad44c83e7..ccf4cb3eff 100644 --- a/Core/Code/DataManagement/mitkDisplayGeometry.cpp +++ b/Core/Code/DataManagement/mitkDisplayGeometry.cpp @@ -1,614 +1,618 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #include "mitkDisplayGeometry.h" itk::LightObject::Pointer mitk::DisplayGeometry::InternalClone() const { // itkExceptionMacro(<<"calling mitk::DisplayGeometry::Clone does not make much sense."); DisplayGeometry* returnValue = const_cast(this); return returnValue; } bool mitk::DisplayGeometry::IsValid() const { return m_WorldGeometry.IsNotNull() && m_WorldGeometry->IsValid(); } unsigned long mitk::DisplayGeometry::GetMTime() const { if((m_WorldGeometry.IsNotNull()) && (PlaneGeometry::GetMTime() < m_WorldGeometry->GetMTime())) { Modified(); } return PlaneGeometry::GetMTime(); } //const mitk::TimeBounds& mitk::DisplayGeometry::GetTimeBounds() const //{ // if(m_WorldGeometry.IsNull()) // { // return m_TimeBounds; // } // // return m_WorldGeometry->GetTimeBounds(); //} // size definition methods void mitk::DisplayGeometry::SetWorldGeometry(const PlaneGeometry* aWorldGeometry) { m_WorldGeometry = aWorldGeometry; Modified(); } bool mitk::DisplayGeometry::SetOriginInMM(const Vector2D& origin_mm) { m_OriginInMM = origin_mm; WorldToDisplay(m_OriginInMM, m_OriginInDisplayUnits); Modified(); return !this->RefitVisibleRect(); } mitk::Vector2D mitk::DisplayGeometry::GetOriginInMM() const { return m_OriginInMM; } mitk::Vector2D mitk::DisplayGeometry::GetOriginInDisplayUnits() const { return m_OriginInDisplayUnits; } void mitk::DisplayGeometry::SetSizeInDisplayUnits(unsigned int width, unsigned int height, bool keepDisplayedRegion) { Vector2D oldSizeInMM( m_SizeInMM ); Point2D oldCenterInMM; if(keepDisplayedRegion) { Point2D centerInDisplayUnits; centerInDisplayUnits[0] = m_SizeInDisplayUnits[0]*0.5; centerInDisplayUnits[1] = m_SizeInDisplayUnits[1]*0.5; DisplayToWorld(centerInDisplayUnits, oldCenterInMM); } m_SizeInDisplayUnits[0]=width; m_SizeInDisplayUnits[1]=height; if(m_SizeInDisplayUnits[0] <= 0) m_SizeInDisplayUnits[0] = 1; if(m_SizeInDisplayUnits[1] <= 0) m_SizeInDisplayUnits[1] = 1; DisplayToWorld(m_SizeInDisplayUnits, m_SizeInMM); if(keepDisplayedRegion) { Point2D positionOfOldCenterInCurrentDisplayUnits; WorldToDisplay(oldCenterInMM, positionOfOldCenterInCurrentDisplayUnits); Point2D currentNewCenterInDisplayUnits; currentNewCenterInDisplayUnits[0] = m_SizeInDisplayUnits[0]*0.5; currentNewCenterInDisplayUnits[1] = m_SizeInDisplayUnits[1]*0.5; Vector2D shift; shift=positionOfOldCenterInCurrentDisplayUnits-currentNewCenterInDisplayUnits; MoveBy(shift); Zoom(m_SizeInMM.GetNorm()/oldSizeInMM.GetNorm(), currentNewCenterInDisplayUnits); } Modified(); } mitk::Vector2D mitk::DisplayGeometry::GetSizeInDisplayUnits() const { return m_SizeInDisplayUnits; } mitk::Vector2D mitk::DisplayGeometry::GetSizeInMM() const { return m_SizeInMM; } unsigned int mitk::DisplayGeometry::GetDisplayWidth() const { assert(m_SizeInDisplayUnits[0] >= 0); return (unsigned int)m_SizeInDisplayUnits[0]; } unsigned int mitk::DisplayGeometry::GetDisplayHeight() const { assert(m_SizeInDisplayUnits[1] >= 0); return (unsigned int)m_SizeInDisplayUnits[1]; } // zooming, panning, restriction of both void mitk::DisplayGeometry::SetConstrainZoomingAndPanning(bool constrain) { m_ConstrainZoomingAndPanning = constrain; if (m_ConstrainZoomingAndPanning) { this->RefitVisibleRect(); } } bool mitk::DisplayGeometry::GetConstrainZommingAndPanning() const { return m_ConstrainZoomingAndPanning; } bool mitk::DisplayGeometry::SetScaleFactor(ScalarType mmPerDisplayUnit) { if(mmPerDisplayUnit<0.0001) { mmPerDisplayUnit=0.0001; } m_ScaleFactorMMPerDisplayUnit = mmPerDisplayUnit; assert(m_ScaleFactorMMPerDisplayUnit < itk::NumericTraits::infinity()); DisplayToWorld(m_SizeInDisplayUnits, m_SizeInMM); return !this->RefitVisibleRect(); } mitk::ScalarType mitk::DisplayGeometry::GetScaleFactorMMPerDisplayUnit() const { return m_ScaleFactorMMPerDisplayUnit; } // Zooms with a factor (1.0=identity) around the specified center in display units bool mitk::DisplayGeometry::Zoom(ScalarType factor, const Point2D& centerInDisplayUnits) { assert(factor > 0); if ( SetScaleFactor(m_ScaleFactorMMPerDisplayUnit/factor) ) { return SetOriginInMM(m_OriginInMM-centerInDisplayUnits.GetVectorFromOrigin()*(1-factor)*m_ScaleFactorMMPerDisplayUnit); } else { return false; } } // Zooms with a factor (1.0=identity) around the specified center, but tries (if its within view contraints) to match the center in display units with the center in world coordinates. bool mitk::DisplayGeometry::ZoomWithFixedWorldCoordinates(ScalarType factor, const Point2D& focusDisplayUnits, const Point2D& focusUnitsInMM ) { assert(factor > 0); - SetScaleFactor(m_ScaleFactorMMPerDisplayUnit/factor); - SetOriginInMM(focusUnitsInMM.GetVectorFromOrigin()-focusDisplayUnits.GetVectorFromOrigin()*m_ScaleFactorMMPerDisplayUnit); + if (factor != 1.0) + { + SetScaleFactor(m_ScaleFactorMMPerDisplayUnit/factor); + SetOriginInMM(focusUnitsInMM.GetVectorFromOrigin()-focusDisplayUnits.GetVectorFromOrigin()*m_ScaleFactorMMPerDisplayUnit); + } + return true; } bool mitk::DisplayGeometry::MoveBy(const Vector2D& shiftInDisplayUnits) { SetOriginInMM(m_OriginInMM+shiftInDisplayUnits*m_ScaleFactorMMPerDisplayUnit); Modified(); return !this->RefitVisibleRect(); } void mitk::DisplayGeometry::Fit() { if((m_WorldGeometry.IsNull()) || (m_WorldGeometry->IsValid() == false)) return; /// \FIXME: try to remove all the casts int width=(int)m_SizeInDisplayUnits[0]; int height=(int)m_SizeInDisplayUnits[1]; ScalarType w = width; ScalarType h = height; const ScalarType& widthInMM = m_WorldGeometry->GetExtentInMM(0); const ScalarType& heightInMM = m_WorldGeometry->GetExtentInMM(1); ScalarType aspRatio=((ScalarType)widthInMM)/heightInMM; ScalarType x = (ScalarType)w/widthInMM; ScalarType y = (ScalarType)h/heightInMM; if (x > y) { w = (int) (aspRatio*h); } else { h = (int) (w/aspRatio); } if(w>0) { SetScaleFactor(widthInMM/w); } Vector2D origin_display; origin_display[0]=-(width-w)/2.0; origin_display[1]=-(height-h)/2.0; SetOriginInMM(origin_display*m_ScaleFactorMMPerDisplayUnit); this->RefitVisibleRect(); Modified(); } // conversion methods void mitk::DisplayGeometry::DisplayToWorld(const Point2D &pt_display, Point2D &pt_mm) const { pt_mm[0]=m_ScaleFactorMMPerDisplayUnit*pt_display[0]+m_OriginInMM[0]; pt_mm[1]=m_ScaleFactorMMPerDisplayUnit*pt_display[1]+m_OriginInMM[1]; } void mitk::DisplayGeometry::WorldToDisplay(const Point2D &pt_mm, Point2D &pt_display) const { pt_display[0]=(pt_mm[0]-m_OriginInMM[0])*(1.0/m_ScaleFactorMMPerDisplayUnit); pt_display[1]=(pt_mm[1]-m_OriginInMM[1])*(1.0/m_ScaleFactorMMPerDisplayUnit); } void mitk::DisplayGeometry::DisplayToWorld(const Vector2D &vec_display, Vector2D &vec_mm) const { vec_mm=vec_display*m_ScaleFactorMMPerDisplayUnit; } void mitk::DisplayGeometry::WorldToDisplay(const Vector2D &vec_mm, Vector2D &vec_display) const { vec_display=vec_mm*(1.0/m_ScaleFactorMMPerDisplayUnit); } void mitk::DisplayGeometry::ULDisplayToMM(const Point2D &pt_ULdisplay, Point2D &pt_mm) const { ULDisplayToDisplay(pt_ULdisplay, pt_mm); DisplayToWorld(pt_mm, pt_mm); } void mitk::DisplayGeometry::MMToULDisplay(const Point2D &pt_mm, Point2D &pt_ULdisplay) const { WorldToDisplay(pt_mm, pt_ULdisplay); DisplayToULDisplay(pt_ULdisplay, pt_ULdisplay); } void mitk::DisplayGeometry::ULDisplayToMM(const Vector2D &vec_ULdisplay, Vector2D &vec_mm) const { ULDisplayToDisplay(vec_ULdisplay, vec_mm); DisplayToWorld(vec_mm, vec_mm); } void mitk::DisplayGeometry::MMToULDisplay(const Vector2D &vec_mm, Vector2D &vec_ULdisplay) const { WorldToDisplay(vec_mm, vec_ULdisplay); DisplayToULDisplay(vec_ULdisplay, vec_ULdisplay); } void mitk::DisplayGeometry::ULDisplayToDisplay(const Point2D &pt_ULdisplay, Point2D &pt_display) const { pt_display[0]=pt_ULdisplay[0]; pt_display[1]=GetDisplayHeight()-pt_ULdisplay[1]; } void mitk::DisplayGeometry::DisplayToULDisplay(const Point2D &pt_display, Point2D &pt_ULdisplay) const { ULDisplayToDisplay(pt_display, pt_ULdisplay); } void mitk::DisplayGeometry::ULDisplayToDisplay(const Vector2D &vec_ULdisplay, Vector2D &vec_display) const { vec_display[0]= vec_ULdisplay[0]; vec_display[1]=-vec_ULdisplay[1]; } void mitk::DisplayGeometry::DisplayToULDisplay(const Vector2D &vec_display, Vector2D &vec_ULdisplay) const { ULDisplayToDisplay(vec_display, vec_ULdisplay); } bool mitk::DisplayGeometry::Project(const Point3D &pt3d_mm, Point3D &projectedPt3d_mm) const { if(m_WorldGeometry.IsNotNull()) { return m_WorldGeometry->Project(pt3d_mm, projectedPt3d_mm); } else { return false; } } bool mitk::DisplayGeometry::Project(const Point3D & atPt3d_mm, const Vector3D &vec3d_mm, Vector3D &projectedVec3d_mm) const { if(m_WorldGeometry.IsNotNull()) { return m_WorldGeometry->Project(atPt3d_mm, vec3d_mm, projectedVec3d_mm); } else { return false; } } bool mitk::DisplayGeometry::Project(const Vector3D &vec3d_mm, Vector3D &projectedVec3d_mm) const { if(m_WorldGeometry.IsNotNull()) { return m_WorldGeometry->Project(vec3d_mm, projectedVec3d_mm); } else { return false; } } bool mitk::DisplayGeometry::Map(const Point3D &pt3d_mm, Point2D &pt2d_mm) const { if(m_WorldGeometry.IsNotNull()) { return m_WorldGeometry->Map(pt3d_mm, pt2d_mm); } else { return false; } } void mitk::DisplayGeometry::Map(const Point2D &pt2d_mm, Point3D &pt3d_mm) const { if(m_WorldGeometry.IsNull()) return; m_WorldGeometry->Map(pt2d_mm, pt3d_mm); } bool mitk::DisplayGeometry::Map(const Point3D & atPt3d_mm, const Vector3D &vec3d_mm, Vector2D &vec2d_mm) const { if(m_WorldGeometry.IsNotNull()) { return m_WorldGeometry->Map(atPt3d_mm, vec3d_mm, vec2d_mm); } else { return false; } } void mitk::DisplayGeometry::Map(const Point2D & atPt2d_mm, const Vector2D &vec2d_mm, Vector3D &vec3d_mm) const { if(m_WorldGeometry.IsNull()) return; m_WorldGeometry->Map(atPt2d_mm, vec2d_mm, vec3d_mm); } // protected methods mitk::DisplayGeometry::DisplayGeometry() : PlaneGeometry() ,m_ScaleFactorMMPerDisplayUnit(1.0) ,m_WorldGeometry(NULL) ,m_ConstrainZoomingAndPanning(true) ,m_MaxWorldViewPercentage(1.0) ,m_MinWorldViewPercentage(0.1) { m_OriginInMM.Fill(0.0); m_OriginInDisplayUnits.Fill(0.0); m_SizeInMM.Fill(1.0); m_SizeInDisplayUnits.Fill(10.0); } mitk::DisplayGeometry::~DisplayGeometry() { } bool mitk::DisplayGeometry::RefitVisibleRect() { // do nothing if not asked to if (!m_ConstrainZoomingAndPanning) return false; // don't allow recursion (need to be fixed, singleton) static bool inRecalculate = false; if (inRecalculate) return false; inRecalculate = true; // rename some basic measures of the current viewport and world geometry (MM = milimeters Px = Pixels = display units) float displayXMM = m_OriginInMM[0]; float displayYMM = m_OriginInMM[1]; float displayWidthPx = m_SizeInDisplayUnits[0]; float displayHeightPx = m_SizeInDisplayUnits[1]; float displayWidthMM = m_SizeInDisplayUnits[0] * m_ScaleFactorMMPerDisplayUnit; float displayHeightMM = m_SizeInDisplayUnits[1] * m_ScaleFactorMMPerDisplayUnit; float worldWidthMM = m_WorldGeometry->GetExtentInMM(0); float worldHeightMM = m_WorldGeometry->GetExtentInMM(1); // reserve variables for the correction logic to save a corrected origin and zoom factor Vector2D newOrigin = m_OriginInMM; bool correctPanning = false; float newScaleFactor = m_ScaleFactorMMPerDisplayUnit; bool correctZooming = false; // start of the correction logic // zoom to big means: // at a given percentage of the world's width/height should be visible. Otherwise // the whole screen could show only one pixel // // zoom to small means: // zooming out should be limited at the point where the smaller of the world's sides is completely visible bool zoomXtooSmall = displayWidthPx * m_ScaleFactorMMPerDisplayUnit > m_MaxWorldViewPercentage * worldWidthMM; bool zoomXtooBig = displayWidthPx * m_ScaleFactorMMPerDisplayUnit < m_MinWorldViewPercentage * worldWidthMM; bool zoomYtooSmall = displayHeightPx * m_ScaleFactorMMPerDisplayUnit > m_MaxWorldViewPercentage * worldHeightMM; bool zoomYtooBig = displayHeightPx * m_ScaleFactorMMPerDisplayUnit < m_MinWorldViewPercentage * worldHeightMM; // constrain zooming in both direction if ( zoomXtooBig && zoomYtooBig) { double fx = worldWidthMM * m_MinWorldViewPercentage / displayWidthPx; double fy = worldHeightMM * m_MinWorldViewPercentage / displayHeightPx; newScaleFactor = fx < fy ? fx : fy; correctZooming = true; } // constrain zooming in x direction else if ( zoomXtooBig ) { newScaleFactor = worldWidthMM * m_MinWorldViewPercentage / displayWidthPx; correctZooming = true; } // constrain zooming in y direction else if ( zoomYtooBig ) { newScaleFactor = worldHeightMM * m_MinWorldViewPercentage / displayHeightPx; correctZooming = true; } // constrain zooming out // we stop zooming out at these situations: // // *** display // --- image // // ********************** // * * x side maxed out // * * // *--------------------* // *| |* // *| |* // *--------------------* // * * // * * // * * // ********************** // // ********************** // * |------| * y side maxed out // * | | * // * | | * // * | | * // * | | * // * | | * // * | | * // * | | * // * |------| * // ********************** // // In both situations we center the not-maxed out direction // if ( zoomXtooSmall && zoomYtooSmall ) { // determine and set the bigger scale factor float fx = worldWidthMM * m_MaxWorldViewPercentage / displayWidthPx; float fy = worldHeightMM * m_MaxWorldViewPercentage / displayHeightPx; newScaleFactor = fx > fy ? fx : fy; correctZooming = true; } // actually execute correction if (correctZooming) { SetScaleFactor(newScaleFactor); } displayWidthMM = m_SizeInDisplayUnits[0] * m_ScaleFactorMMPerDisplayUnit; displayHeightMM = m_SizeInDisplayUnits[1] * m_ScaleFactorMMPerDisplayUnit; // constrain panning if(worldWidthMM center x newOrigin[0] = (worldWidthMM - displayWidthMM) / 2.0; correctPanning = true; } else { // make sure left display border inside our world if (displayXMM < 0) { newOrigin[0] = 0; correctPanning = true; } // make sure right display border inside our world else if (displayXMM + displayWidthMM > worldWidthMM) { newOrigin[0] = worldWidthMM - displayWidthMM; correctPanning = true; } } if (worldHeightMM center y newOrigin[1] = (worldHeightMM - displayHeightMM) / 2.0; correctPanning = true; } else { // make sure top display border inside our world if (displayYMM + displayHeightMM > worldHeightMM) { newOrigin[1] = worldHeightMM - displayHeightMM; correctPanning = true; } // make sure bottom display border inside our world else if (displayYMM < 0) { newOrigin[1] = 0; correctPanning = true; } } if (correctPanning) { SetOriginInMM( newOrigin ); } inRecalculate = false; if ( correctPanning || correctZooming ) { Modified(); } // return true if any correction has been made return correctPanning || correctZooming; } void mitk::DisplayGeometry::PrintSelf(std::ostream& os, itk::Indent indent) const { if(m_WorldGeometry.IsNull()) { os << indent << " WorldGeometry: " << "NULL" << std::endl; } else { m_WorldGeometry->Print(os, indent); os << indent << " OriginInMM: " << m_OriginInMM << std::endl; os << indent << " OriginInDisplayUnits: " << m_OriginInDisplayUnits << std::endl; os << indent << " SizeInMM: " << m_SizeInMM << std::endl; os << indent << " SizeInDisplayUnits: " << m_SizeInDisplayUnits << std::endl; os << indent << " ScaleFactorMMPerDisplayUni: " << m_ScaleFactorMMPerDisplayUnit << std::endl; } Superclass::PrintSelf(os,indent); } diff --git a/Core/Code/Interactions/mitkDisplayInteractor.cpp b/Core/Code/Interactions/mitkDisplayInteractor.cpp index b16b8ad48d..c38d8c2860 100644 --- a/Core/Code/Interactions/mitkDisplayInteractor.cpp +++ b/Core/Code/Interactions/mitkDisplayInteractor.cpp @@ -1,420 +1,424 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #include "mitkDisplayInteractor.h" #include "mitkBaseRenderer.h" #include "mitkInteractionPositionEvent.h" #include "mitkPropertyList.h" #include // level window #include "mitkStandaloneDataStorage.h" #include "mitkNodePredicateDataType.h" #include "mitkLevelWindowProperty.h" #include "mitkLevelWindow.h" void mitk::DisplayInteractor::Notify(InteractionEvent* interactionEvent, bool isHandled) { // to use the state machine pattern, // the event is passed to the state machine interface to be handled if (!isHandled || m_AlwaysReact) { this->HandleEvent(interactionEvent, NULL); } } void mitk::DisplayInteractor::ConnectActionsAndFunctions() { CONNECT_CONDITION( "check_position_event", CheckPositionEvent ); CONNECT_FUNCTION("init", Init); CONNECT_FUNCTION("move", Move); CONNECT_FUNCTION("zoom", Zoom); CONNECT_FUNCTION("scroll", Scroll); CONNECT_FUNCTION("ScrollOneDown", ScrollOneDown); CONNECT_FUNCTION("ScrollOneUp", ScrollOneUp); CONNECT_FUNCTION("levelWindow", AdjustLevelWindow); } mitk::DisplayInteractor::DisplayInteractor() : m_IndexToSliceModifier(4) , m_AutoRepeat(false) , m_InvertScrollDirection( false ) , m_InvertZoomDirection( false ) , m_InvertMoveDirection( false ) , m_InvertLevelWindowDirection( false ) , m_AlwaysReact(false) , m_ZoomFactor(2) { m_StartDisplayCoordinate.Fill(0); m_LastDisplayCoordinate.Fill(0); m_CurrentDisplayCoordinate.Fill(0); } mitk::DisplayInteractor::~DisplayInteractor() { } bool mitk::DisplayInteractor::CheckPositionEvent( const InteractionEvent* interactionEvent ) { const InteractionPositionEvent* positionEvent = dynamic_cast(interactionEvent); if (positionEvent == NULL) { return false; } return true; } bool mitk::DisplayInteractor::Init(StateMachineAction*, InteractionEvent* interactionEvent) { BaseRenderer* sender = interactionEvent->GetSender(); InteractionPositionEvent* positionEvent = static_cast(interactionEvent); Vector2D origin = sender->GetDisplayGeometry()->GetOriginInMM(); double scaleFactorMMPerDisplayUnit = sender->GetDisplayGeometry()->GetScaleFactorMMPerDisplayUnit(); m_StartDisplayCoordinate = positionEvent->GetPointerPositionOnScreen(); m_LastDisplayCoordinate = positionEvent->GetPointerPositionOnScreen(); m_CurrentDisplayCoordinate = positionEvent->GetPointerPositionOnScreen(); m_StartCoordinateInMM = mitk::Point2D( (origin + m_StartDisplayCoordinate.GetVectorFromOrigin() * scaleFactorMMPerDisplayUnit).GetDataPointer()); return true; } bool mitk::DisplayInteractor::Move(StateMachineAction*, InteractionEvent* interactionEvent) { BaseRenderer* sender = interactionEvent->GetSender(); InteractionPositionEvent* positionEvent = static_cast(interactionEvent); float invertModifier = -1.0; if ( m_InvertMoveDirection ) { invertModifier = 1.0; } // perform translation sender->GetDisplayGeometry()->MoveBy( (positionEvent->GetPointerPositionOnScreen() - m_LastDisplayCoordinate) * invertModifier ); sender->GetRenderingManager()->RequestUpdate(sender->GetRenderWindow()); m_LastDisplayCoordinate = positionEvent->GetPointerPositionOnScreen(); return true; } bool mitk::DisplayInteractor::Zoom(StateMachineAction*, InteractionEvent* interactionEvent) { const BaseRenderer::Pointer sender = interactionEvent->GetSender(); InteractionPositionEvent* positionEvent = static_cast(interactionEvent); float factor = 1.0; float distance = 0; if (m_ZoomDirection == "updown") { distance = m_CurrentDisplayCoordinate[1] - m_LastDisplayCoordinate[1]; } else { distance = m_CurrentDisplayCoordinate[0] - m_LastDisplayCoordinate[0]; } if ( m_InvertZoomDirection ) { distance *= -1.0; } - // set zooming speed if (distance < 0.0) { factor = 1.0 / m_ZoomFactor; } else if (distance > 0.0) { factor = 1.0 * m_ZoomFactor; } - sender->GetDisplayGeometry()->ZoomWithFixedWorldCoordinates(factor, m_StartDisplayCoordinate, m_StartCoordinateInMM); - sender->GetRenderingManager()->RequestUpdate(sender->GetRenderWindow()); + + if (factor != 1.0) + { + sender->GetDisplayGeometry()->ZoomWithFixedWorldCoordinates(factor, m_StartDisplayCoordinate, m_StartCoordinateInMM); + sender->GetRenderingManager()->RequestUpdate(sender->GetRenderWindow()); + } + m_LastDisplayCoordinate = m_CurrentDisplayCoordinate; m_CurrentDisplayCoordinate = positionEvent->GetPointerPositionOnScreen(); return true; } bool mitk::DisplayInteractor::Scroll(StateMachineAction*, InteractionEvent* interactionEvent) { InteractionPositionEvent* positionEvent = static_cast(interactionEvent); mitk::SliceNavigationController::Pointer sliceNaviController = interactionEvent->GetSender()->GetSliceNavigationController(); if (sliceNaviController) { int delta = 0; // Scrolling direction if (m_ScrollDirection == "updown") { delta = static_cast(m_LastDisplayCoordinate[1] - positionEvent->GetPointerPositionOnScreen()[1]); } else { delta = static_cast(m_LastDisplayCoordinate[0] - positionEvent->GetPointerPositionOnScreen()[0]); } if ( m_InvertScrollDirection ) { delta *= -1; } // Set how many pixels the mouse has to be moved to scroll one slice // if we moved less than 'm_IndexToSliceModifier' pixels slice ONE slice only if (delta > 0 && delta < m_IndexToSliceModifier) { delta = m_IndexToSliceModifier; } else if (delta < 0 && delta > -m_IndexToSliceModifier) { delta = -m_IndexToSliceModifier; } delta /= m_IndexToSliceModifier; int newPos = sliceNaviController->GetSlice()->GetPos() + delta; // if auto repeat is on, start at first slice if you reach the last slice and vice versa int maxSlices = sliceNaviController->GetSlice()->GetSteps(); if (m_AutoRepeat) { while (newPos < 0) { newPos += maxSlices; } while (newPos >= maxSlices) { newPos -= maxSlices; } } else { // if the new slice is below 0 we still show slice 0 // due to the stepper using unsigned int we have to do this ourselves if (newPos < 1) { newPos = 0; } } // set the new position sliceNaviController->GetSlice()->SetPos(newPos); m_LastDisplayCoordinate = m_CurrentDisplayCoordinate; m_CurrentDisplayCoordinate = positionEvent->GetPointerPositionOnScreen(); } return true; } bool mitk::DisplayInteractor::ScrollOneDown(StateMachineAction*, InteractionEvent* interactionEvent) { mitk::SliceNavigationController::Pointer sliceNaviController = interactionEvent->GetSender()->GetSliceNavigationController(); if (!sliceNaviController->GetSliceLocked()) { mitk::Stepper* stepper = sliceNaviController->GetSlice(); if (stepper->GetSteps() <= 1) { stepper = sliceNaviController->GetTime(); } stepper->Next(); } return true; } bool mitk::DisplayInteractor::ScrollOneUp(StateMachineAction*, InteractionEvent* interactionEvent) { mitk::SliceNavigationController::Pointer sliceNaviController = interactionEvent->GetSender()->GetSliceNavigationController(); if (!sliceNaviController->GetSliceLocked()) { mitk::Stepper* stepper = sliceNaviController->GetSlice(); if (stepper->GetSteps() <= 1) { stepper = sliceNaviController->GetTime(); } stepper->Previous(); return true; } return false; } bool mitk::DisplayInteractor::AdjustLevelWindow(StateMachineAction*, InteractionEvent* interactionEvent) { BaseRenderer::Pointer sender = interactionEvent->GetSender(); InteractionPositionEvent* positionEvent = static_cast(interactionEvent); m_LastDisplayCoordinate = m_CurrentDisplayCoordinate; m_CurrentDisplayCoordinate = positionEvent->GetPointerPositionOnScreen(); // search for active image mitk::DataStorage::Pointer storage = sender->GetDataStorage(); mitk::DataNode::Pointer node = NULL; mitk::DataStorage::SetOfObjects::ConstPointer allImageNodes = storage->GetSubset(mitk::NodePredicateDataType::New("Image")); for (unsigned int i = 0; i < allImageNodes->size(); i++) { bool isActiveImage = false; bool propFound = allImageNodes->at(i)->GetBoolProperty("imageForLevelWindow", isActiveImage); if (propFound && isActiveImage) { node = allImageNodes->at(i); continue; } } if (node.IsNull()) { node = storage->GetNode(mitk::NodePredicateDataType::New("Image")); } if (node.IsNull()) { return false; } mitk::LevelWindow lv = mitk::LevelWindow(); node->GetLevelWindow(lv); ScalarType level = lv.GetLevel(); ScalarType window = lv.GetWindow(); int levelIndex = 0; int windowIndex = 1; if ( m_LevelDirection != "leftright" ) { levelIndex = 1; windowIndex = 0; } int directionModifier = 1; if ( m_InvertLevelWindowDirection ) { directionModifier = -1; } // calculate adjustments from mouse movements level += (m_CurrentDisplayCoordinate[levelIndex] - m_LastDisplayCoordinate[levelIndex]) * static_cast(2) * directionModifier; window += (m_CurrentDisplayCoordinate[windowIndex] - m_LastDisplayCoordinate[windowIndex]) * static_cast(2) * directionModifier; lv.SetLevelWindow(level, window); dynamic_cast(node->GetProperty("levelwindow"))->SetLevelWindow(lv); sender->GetRenderingManager()->RequestUpdateAll(); return true; } void mitk::DisplayInteractor::ConfigurationChanged() { mitk::PropertyList::Pointer properties = GetAttributes(); // auto repeat std::string strAutoRepeat = ""; if (properties->GetStringProperty("autoRepeat", strAutoRepeat)) { if (strAutoRepeat == "true") { m_AutoRepeat = true; } else { m_AutoRepeat = false; } } // pixel movement for scrolling one slice std::string strPixelPerSlice = ""; if (properties->GetStringProperty("pixelPerSlice", strPixelPerSlice)) { m_IndexToSliceModifier = atoi(strPixelPerSlice.c_str()); } else { m_IndexToSliceModifier = 4; } // scroll direction if (!properties->GetStringProperty("scrollDirection", m_ScrollDirection)) { m_ScrollDirection = "updown"; } m_InvertScrollDirection = GetBoolProperty( properties, "invertScrollDirection", false ); // zoom direction if (!properties->GetStringProperty("zoomDirection", m_ZoomDirection)) { m_ZoomDirection = "updown"; } m_InvertZoomDirection = GetBoolProperty( properties, "invertZoomDirection", false ); m_InvertMoveDirection = GetBoolProperty( properties, "invertMoveDirection", false ); if (!properties->GetStringProperty("levelWindowDirection", m_LevelDirection)) { m_LevelDirection = "leftright"; } m_InvertLevelWindowDirection = GetBoolProperty( properties, "invertLevelWindowDirection", false ); // zoom factor std::string strZoomFactor = ""; properties->GetStringProperty("zoomFactor", strZoomFactor); m_ZoomFactor = .05; if (atoi(strZoomFactor.c_str()) > 0) { m_ZoomFactor = 1.0 + (atoi(strZoomFactor.c_str()) / 100.0); } // allwaysReact std::string strAlwaysReact = ""; if (properties->GetStringProperty("alwaysReact", strAlwaysReact)) { if (strAlwaysReact == "true") { m_AlwaysReact = true; } else { m_AlwaysReact = false; } } else { m_AlwaysReact = false; } } bool mitk::DisplayInteractor::FilterEvents(InteractionEvent* /*interactionEvent*/, DataNode* /*dataNode*/) { return true; } bool mitk::DisplayInteractor::GetBoolProperty( mitk::PropertyList::Pointer propertyList, const char* propertyName, bool defaultValue ) { std::string valueAsString; if ( !propertyList->GetStringProperty( propertyName, valueAsString ) ) { return defaultValue; } else { if ( valueAsString == "true" ) { return true; } else { return false; } } } diff --git a/Plugins/PluginList.cmake b/Plugins/PluginList.cmake index 6abfe68531..a630fbbacf 100644 --- a/Plugins/PluginList.cmake +++ b/Plugins/PluginList.cmake @@ -1,57 +1,58 @@ # Plug-ins must be ordered according to their dependencies if (MITK_USE_Qt4) set(MITK_EXT_PLUGINS org.mitk.core.services:ON org.mitk.gui.common:ON org.mitk.planarfigure:ON org.mitk.core.ext:OFF org.mitk.core.jobs:OFF org.mitk.diffusionimaging:OFF org.mitk.simulation:OFF org.mitk.gui.qt.application:ON org.mitk.gui.qt.coreapplication:OFF org.mitk.gui.qt.ext:OFF org.mitk.gui.qt.extapplication:OFF org.mitk.gui.qt.common:ON org.mitk.gui.qt.stdmultiwidgeteditor:ON org.mitk.gui.qt.common.legacy:OFF org.mitk.gui.qt.cmdlinemodules:OFF org.mitk.gui.qt.diffusionimagingapp:OFF org.mitk.gui.qt.datamanager:ON org.mitk.gui.qt.datamanagerlight:OFF org.mitk.gui.qt.properties:ON org.mitk.gui.qt.basicimageprocessing:OFF org.mitk.gui.qt.dicom:OFF org.mitk.gui.qt.diffusionimaging:OFF org.mitk.gui.qt.dtiatlasapp:OFF org.mitk.gui.qt.igtexamples:OFF org.mitk.gui.qt.igttracking:OFF org.mitk.gui.qt.imagecropper:OFF org.mitk.gui.qt.imagenavigator:ON + org.mitk.gui.qt.candystore:OFF org.mitk.gui.qt.materialeditor:OFF org.mitk.gui.qt.measurementtoolbox:OFF org.mitk.gui.qt.moviemaker:OFF org.mitk.gui.qt.pointsetinteraction:OFF org.mitk.gui.qt.python:OFF org.mitk.gui.qt.registration:OFF org.mitk.gui.qt.remeshing:OFF org.mitk.gui.qt.segmentation:OFF org.mitk.gui.qt.simulation:OFF org.mitk.gui.qt.toftutorial:OFF org.mitk.gui.qt.tofutil:OFF org.mitk.gui.qt.ugvisualization:OFF org.mitk.gui.qt.ultrasound:OFF org.mitk.gui.qt.volumevisualization:OFF org.mitk.gui.qt.eventrecorder:OFF org.mitk.gui.qt.xnat:OFF ) else() set(MITK_EXT_PLUGINS # empty so far ) endif() diff --git a/Plugins/org.mitk.gui.qt.candystore/CMakeLists.txt b/Plugins/org.mitk.gui.qt.candystore/CMakeLists.txt new file mode 100644 index 0000000000..e34977274f --- /dev/null +++ b/Plugins/org.mitk.gui.qt.candystore/CMakeLists.txt @@ -0,0 +1,8 @@ +project(org_mitk_gui_qt_candystore) + +MACRO_CREATE_MITK_CTK_PLUGIN( + EXPORT_DIRECTIVE CANDYSTORE_EXPORT + EXPORTED_INCLUDE_SUFFIXES src + MODULE_DEPENDENCIES MitkQtWidgetsExt + PACKAGE_DEPENDS CTK +) diff --git a/Plugins/org.mitk.gui.qt.candystore/documentation/UserManual/Manual.dox b/Plugins/org.mitk.gui.qt.candystore/documentation/UserManual/Manual.dox new file mode 100644 index 0000000000..eb80add408 --- /dev/null +++ b/Plugins/org.mitk.gui.qt.candystore/documentation/UserManual/Manual.dox @@ -0,0 +1,18 @@ +/** +\page org_mitk_gui_qt_candystore Candy Store + +\imageMacro{icon.png,"Icon of Candy Store",2.00} + +Available sections: + - \ref org_mitk_gui_qt_candystoreOverview + +\section org_mitk_gui_qt_candystoreOverview +Describe the features of your awesome plugin here +
    +
  • Increases productivity +
  • Creates beautiful images +
  • Generates PhD thesis +
  • Brings world peace +
+ +*/ diff --git a/Plugins/org.mitk.gui.qt.candystore/documentation/UserManual/icon.xpm b/Plugins/org.mitk.gui.qt.candystore/documentation/UserManual/icon.xpm new file mode 100644 index 0000000000..9057c20bc6 --- /dev/null +++ b/Plugins/org.mitk.gui.qt.candystore/documentation/UserManual/icon.xpm @@ -0,0 +1,21 @@ +/* XPM */ +static const char * icon_xpm[] = { +"16 16 2 1", +" c #FF0000", +". c #000000", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" "}; diff --git a/Plugins/org.mitk.gui.qt.candystore/documentation/doxygen/modules.dox b/Plugins/org.mitk.gui.qt.candystore/documentation/doxygen/modules.dox new file mode 100644 index 0000000000..75081965a2 --- /dev/null +++ b/Plugins/org.mitk.gui.qt.candystore/documentation/doxygen/modules.dox @@ -0,0 +1,16 @@ +/** + \defgroup org_mitk_gui_qt_candystore org.mitk.gui.qt.candystore + \ingroup MITKPlugins + + \brief Describe your plugin here. + +*/ + +/** + \defgroup org_mitk_gui_qt_candystore_internal Internal + \ingroup org_mitk_gui_qt_candystore + + \brief This subcategory includes the internal classes of the org.mitk.gui.qt.candystore plugin. Other + plugins must not rely on these classes. They contain implementation details and their interface + may change at any time. We mean it. +*/ diff --git a/Plugins/org.mitk.gui.qt.candystore/files.cmake b/Plugins/org.mitk.gui.qt.candystore/files.cmake new file mode 100644 index 0000000000..99d102bb16 --- /dev/null +++ b/Plugins/org.mitk.gui.qt.candystore/files.cmake @@ -0,0 +1,50 @@ +set(SRC_CPP_FILES + QmitkCandyStoreWidget.cpp + QmitkNewPerspectiveDialog.cpp +) + +set(INTERNAL_CPP_FILES + org_mitk_gui_qt_candystore_Activator.cpp + CandyStoreView.cpp +) + +set(UI_FILES + src/internal/CandyStoreViewControls.ui + src/QmitkCandyStoreWidgetControls.ui +) + +set(MOC_H_FILES + src/internal/org_mitk_gui_qt_candystore_Activator.h + src/internal/CandyStoreView.h + + src/QmitkCandyStoreWidget.h + src/mitkQtPerspectiveItem.h + src/mitkQtViewItem.h + src/QmitkNewPerspectiveDialog.h +) + +# list of resource files which can be used by the plug-in +# system without loading the plug-ins shared library, +# for example the icon used in the menu and tabs for the +# plug-in views in the workbench +set(CACHED_RESOURCE_FILES + resources/icon.xpm + resources/Candy_icon.png + plugin.xml +) + +# list of Qt .qrc files which contain additional resources +# specific to this plugin +set(QRC_FILES + +) + +set(CPP_FILES ) + +foreach(file ${SRC_CPP_FILES}) + set(CPP_FILES ${CPP_FILES} src/${file}) +endforeach(file ${SRC_CPP_FILES}) + +foreach(file ${INTERNAL_CPP_FILES}) + set(CPP_FILES ${CPP_FILES} src/internal/${file}) +endforeach(file ${INTERNAL_CPP_FILES}) diff --git a/Plugins/org.mitk.gui.qt.candystore/manifest_headers.cmake b/Plugins/org.mitk.gui.qt.candystore/manifest_headers.cmake new file mode 100644 index 0000000000..6657eca0c2 --- /dev/null +++ b/Plugins/org.mitk.gui.qt.candystore/manifest_headers.cmake @@ -0,0 +1,5 @@ +set(Plugin-Name "Candy Store") +set(Plugin-Version "0.1") +set(Plugin-Vendor "DKFZ, Medical and Biological Informatics") +set(Plugin-ContactAddress "") +set(Require-Plugin org.mitk.gui.qt.common) diff --git a/Plugins/org.mitk.gui.qt.candystore/plugin.xml b/Plugins/org.mitk.gui.qt.candystore/plugin.xml new file mode 100644 index 0000000000..8a9bb6095a --- /dev/null +++ b/Plugins/org.mitk.gui.qt.candystore/plugin.xml @@ -0,0 +1,11 @@ + + + + + + + + diff --git a/Plugins/org.mitk.gui.qt.candystore/resources/Candy_icon.png b/Plugins/org.mitk.gui.qt.candystore/resources/Candy_icon.png new file mode 100644 index 0000000000..f71e77664c Binary files /dev/null and b/Plugins/org.mitk.gui.qt.candystore/resources/Candy_icon.png differ diff --git a/Plugins/org.mitk.gui.qt.candystore/resources/icon.xpm b/Plugins/org.mitk.gui.qt.candystore/resources/icon.xpm new file mode 100644 index 0000000000..9057c20bc6 --- /dev/null +++ b/Plugins/org.mitk.gui.qt.candystore/resources/icon.xpm @@ -0,0 +1,21 @@ +/* XPM */ +static const char * icon_xpm[] = { +"16 16 2 1", +" c #FF0000", +". c #000000", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" "}; diff --git a/Plugins/org.mitk.gui.qt.ext/src/QmitkCandyStoreWidget.cpp b/Plugins/org.mitk.gui.qt.candystore/src/QmitkCandyStoreWidget.cpp similarity index 96% rename from Plugins/org.mitk.gui.qt.ext/src/QmitkCandyStoreWidget.cpp rename to Plugins/org.mitk.gui.qt.candystore/src/QmitkCandyStoreWidget.cpp index 61c8384ddd..03df302846 100644 --- a/Plugins/org.mitk.gui.qt.ext/src/QmitkCandyStoreWidget.cpp +++ b/Plugins/org.mitk.gui.qt.candystore/src/QmitkCandyStoreWidget.cpp @@ -1,757 +1,770 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ //Qmitk headers #include "QmitkCandyStoreWidget.h" // Blueberry #include #include #include #include #include #include // Qt #include #include #include #include class KeywordRegistry { public: KeywordRegistry() { berry::IExtensionPointService::Pointer extensionPointService = berry::Platform::GetExtensionPointService(); berry::IConfigurationElement::vector keywordExts(extensionPointService->GetConfigurationElementsFor("org.blueberry.ui.keywords")); std::string keywordId; std::string keywordLabels; berry::IConfigurationElement::vector::iterator keywordExtsIt; for (keywordExtsIt = keywordExts.begin(); keywordExtsIt != keywordExts.end(); ++keywordExtsIt) { (*keywordExtsIt)->GetAttribute("id", keywordId); (*keywordExtsIt)->GetAttribute("label", keywordLabels); if (m_Keywords.find(keywordId) == m_Keywords.end()) { m_Keywords[keywordId] = std::vector(); } m_Keywords[keywordId].push_back(QString::fromStdString(keywordLabels)); } } std::vector GetKeywords(const std::string& id) { return m_Keywords[id]; } std::vector GetKeywords(const std::vector& ids) { std::vector result; for (unsigned int i = 0; i < ids.size(); ++i) { std::vector< QString > tmpResult; tmpResult = this->GetKeywords(ids[i]); result.insert(result.end(), tmpResult.begin(), tmpResult.end()); } return result; } private: std::map > m_Keywords; }; class ClassFilterProxyModel : public QSortFilterProxyModel { private : bool hasToBeDisplayed(const QModelIndex index) const; bool displayElement(const QModelIndex index) const; public: ClassFilterProxyModel(QObject *parent = NULL); bool filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const; }; ClassFilterProxyModel::ClassFilterProxyModel(QObject *parent): QSortFilterProxyModel(parent) { } bool ClassFilterProxyModel::filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const { QModelIndex index = sourceModel()->index(sourceRow, 0, sourceParent); return hasToBeDisplayed(index); } bool ClassFilterProxyModel::displayElement(const QModelIndex index) const { bool result = false; QString type = sourceModel()->data(index, Qt::DisplayRole).toString(); QStandardItem * item = dynamic_cast(sourceModel())->itemFromIndex(index); if (type.contains(filterRegExp())) { return true; } { mitk::QtViewItem* viewItem = dynamic_cast(item); if (viewItem) { for (unsigned int i = 0; i < viewItem->m_Tags.size(); ++i) { if (viewItem->m_Tags[i].contains(filterRegExp())) { return true; } } if (viewItem->m_Description.contains(filterRegExp())) { return true; } } } { mitk::QtPerspectiveItem* viewItem = dynamic_cast(item); if (viewItem) { for (unsigned int i = 0; i < viewItem->m_Tags.size(); ++i) { if (viewItem->m_Tags[i].contains(filterRegExp())) { return true; } } if (viewItem->m_Description.contains(filterRegExp())) { return true; } } } return result; } bool ClassFilterProxyModel::hasToBeDisplayed(const QModelIndex index) const { bool result = false; if ( sourceModel()->rowCount(index) > 0 ) { for( int ii = 0; ii < sourceModel()->rowCount(index); ii++) { QModelIndex childIndex = sourceModel()->index(ii,0,index); if ( ! childIndex.isValid() ) break; result = hasToBeDisplayed(childIndex); result |= displayElement(index); if (result) { break; } } } else { result = displayElement(index); } return result; } class CandyStorePerspectiveListener: public berry::IPerspectiveListener { public: CandyStorePerspectiveListener(QmitkCandyStoreWidget* p) : parentWidget(p) { } Events::Types GetPerspectiveEventTypes() const { return Events::ACTIVATED | Events::SAVED_AS | Events::DEACTIVATED // remove the following line when command framework is finished | Events::CLOSED | Events::OPENED | Events::PART_CHANGED; } void PerspectiveActivated(berry::IWorkbenchPage::Pointer /*page*/, berry::IPerspectiveDescriptor::Pointer /*perspective*/) { parentWidget->UpdateTreeList(); } void PerspectiveSavedAs(berry::IWorkbenchPage::Pointer /*page*/, berry::IPerspectiveDescriptor::Pointer /*oldPerspective*/, berry::IPerspectiveDescriptor::Pointer /*newPerspective*/) { } void PerspectiveDeactivated(berry::IWorkbenchPage::Pointer /*page*/, berry::IPerspectiveDescriptor::Pointer /*perspective*/) { parentWidget->UpdateTreeList(); } void PerspectiveOpened(berry::IWorkbenchPage::Pointer /*page*/, berry::IPerspectiveDescriptor::Pointer /*perspective*/) { parentWidget->UpdateTreeList(); } void PerspectiveClosed(berry::IWorkbenchPage::Pointer /*page*/, berry::IPerspectiveDescriptor::Pointer /*perspective*/) { parentWidget->UpdateTreeList(); } void PerspectiveChanged(berry::IWorkbenchPage::Pointer, berry::IPerspectiveDescriptor::Pointer, berry::IWorkbenchPartReference::Pointer partRef, const std::string& changeId) { - parentWidget->UpdateTreeList(NULL, partRef.GetPointer(), changeId); + if (changeId=="viewHide" && partRef->GetId()=="org.mitk.views.candystoreview") + berry::PlatformUI::GetWorkbench()->GetActiveWorkbenchWindow()->RemovePerspectiveListener(parentWidget->m_PerspectiveListener); + else + parentWidget->UpdateTreeList(NULL, partRef.GetPointer(), changeId); } private: QmitkCandyStoreWidget* parentWidget; }; struct CandyStoreWindowListener : public berry::IWindowListener { CandyStoreWindowListener(QmitkCandyStoreWidget* switcher) - : switcher(switcher), - m_Done(false) + : switcher(switcher) + , m_Done(false) {} virtual void WindowOpened(berry::IWorkbenchWindow::Pointer window) { if (m_Done) return; if ( switcher->FillTreeList() ) { m_Done = true; switcher->m_PerspectiveListener = CandyStorePerspectiveListener::Pointer(new CandyStorePerspectiveListener(switcher)); window->AddPerspectiveListener(switcher->m_PerspectiveListener); } } virtual void WindowActivated(berry::IWorkbenchWindow::Pointer window) { if (m_Done) return; if ( switcher->FillTreeList() ) { m_Done = true; switcher->m_PerspectiveListener = CandyStorePerspectiveListener::Pointer(new CandyStorePerspectiveListener(switcher)); window->AddPerspectiveListener(switcher->m_PerspectiveListener); } } private: QmitkCandyStoreWidget* switcher; bool m_Done; }; bool compareViews(berry::IViewDescriptor::Pointer a, berry::IViewDescriptor::Pointer b) { if (a.IsNull() || b.IsNull()) return false; return a->GetLabel().compare(b->GetLabel()) < 0; } bool comparePerspectives(berry::IPerspectiveDescriptor::Pointer a, berry::IPerspectiveDescriptor::Pointer b) { if (a.IsNull() || b.IsNull()) return false; return a->GetLabel().compare(b->GetLabel()) < 0; } bool compareQStandardItems(QStandardItem* a, QStandardItem* b) { if (a==NULL || b==NULL) return false; return a->text().compare(b->text()) < 0; } QmitkCandyStoreWidget::QmitkCandyStoreWidget( QWidget * parent, Qt::WindowFlags ) : QWidget(parent) { this->CreateQtPartControl(this); } QmitkCandyStoreWidget::~QmitkCandyStoreWidget() { } void QmitkCandyStoreWidget::CreateQtPartControl( QWidget *parent ) { // create GUI widgets from the Qt Designer's .ui file - m_WindowListener = CandyStoreWindowListener::Pointer(new CandyStoreWindowListener(this)); - berry::PlatformUI::GetWorkbench()->AddWindowListener(m_WindowListener); + if (berry::PlatformUI::GetWorkbench()->GetActiveWorkbenchWindow().IsNotNull()) + { + m_PerspectiveListener = CandyStorePerspectiveListener::Pointer(new CandyStorePerspectiveListener(this)); + berry::PlatformUI::GetWorkbench()->GetActiveWorkbenchWindow()->AddPerspectiveListener(m_PerspectiveListener); + } + else + { + m_WindowListener = CandyStoreWindowListener::Pointer(new CandyStoreWindowListener(this)); + berry::PlatformUI::GetWorkbench()->AddWindowListener(m_WindowListener); + } m_Parent = parent; m_Controls.setupUi( parent ); connect( m_Controls.m_PluginTreeView, SIGNAL(customContextMenuRequested(QPoint)), SLOT(CustomMenuRequested(QPoint))); connect( m_Controls.m_PluginTreeView, SIGNAL(doubleClicked(const QModelIndex&)), SLOT(ItemClicked(const QModelIndex&))); connect( m_Controls.lineEdit, SIGNAL(textChanged(QString)), SLOT(FilterChanged())); m_ContextMenu = new QMenu(m_Controls.m_PluginTreeView); m_Controls.m_PluginTreeView->setContextMenuPolicy(Qt::CustomContextMenu); // Create a new TreeModel for the data m_TreeModel = new QStandardItemModel(); m_FilterProxyModel = new ClassFilterProxyModel(this); m_FilterProxyModel->setSourceModel(m_TreeModel); //proxyModel->setFilterFixedString("Diff"); m_Controls.m_PluginTreeView->setModel(m_FilterProxyModel); FillTreeList(); } void QmitkCandyStoreWidget::UpdateTreeList(QStandardItem* root, berry::IWorkbenchPartReference *partRef, const std::string &changeId) { berry::IWorkbenchPage::Pointer page = berry::PlatformUI::GetWorkbench()->GetActiveWorkbenchWindow()->GetActivePage(); if (page.IsNull()) return; if (root==NULL) root = m_TreeModel->invisibleRootItem(); for (int i=0; irowCount(); i++) { QStandardItem* item = root->child(i); QFont font; if (dynamic_cast(item)) { mitk::QtPerspectiveItem* pItem = dynamic_cast(item); berry::IPerspectiveDescriptor::Pointer currentPersp = page->GetPerspective(); if (currentPersp.IsNotNull() && currentPersp->GetId()==pItem->m_Perspective->GetId()) font.setBold(true); pItem->setFont(font); } mitk::QtViewItem* vItem = dynamic_cast(item); if (vItem) { std::vector viewParts(page->GetViews()); for (unsigned int i=0; iGetPartName()==vItem->m_View->GetLabel()) { font.setBold(true); break; } if( partRef!=NULL && partRef->GetId()==vItem->m_View->GetId() && changeId=="viewHide") font.setBold(false); vItem->setFont(font); } UpdateTreeList(item, partRef, changeId); } } bool QmitkCandyStoreWidget::FillTreeList() { // active workbench window available? if (berry::PlatformUI::GetWorkbench()->GetActiveWorkbenchWindow().IsNull()) return false; + // active page available? berry::IWorkbenchPage::Pointer page = berry::PlatformUI::GetWorkbench()->GetActiveWorkbenchWindow()->GetActivePage(); if (page.IsNull()) return false; // everything is fine and we can remove the window listener - berry::PlatformUI::GetWorkbench()->RemoveWindowListener(m_WindowListener); + if (m_WindowListener.IsNotNull()) + berry::PlatformUI::GetWorkbench()->RemoveWindowListener(m_WindowListener); // initialize tree model m_TreeModel->clear(); QStandardItem *treeRootItem = m_TreeModel->invisibleRootItem(); // get all available perspectives berry::IPerspectiveRegistry* perspRegistry = berry::PlatformUI::GetWorkbench()->GetPerspectiveRegistry(); std::vector perspectiveDescriptors(perspRegistry->GetPerspectives()); std::sort(perspectiveDescriptors.begin(), perspectiveDescriptors.end(), comparePerspectives); // get all Keywords KeywordRegistry keywordRegistry; berry::IPerspectiveDescriptor::Pointer currentPersp = page->GetPerspective(); std::vector perspectiveExcludeList = berry::PlatformUI::GetWorkbench()->GetActiveWorkbenchWindow()->GetPerspectiveExcludeList(); std::vector< QStandardItem* > categoryItems; QStandardItem *perspectiveRootItem = new QStandardItem("Workflows"); perspectiveRootItem->setEditable(false); treeRootItem->appendRow(perspectiveRootItem); for (unsigned int i=0; iGetId()) { skipPerspective = true; break; } if (skipPerspective) continue; //QIcon* pIcon = static_cast(p->GetImageDescriptor()->CreateImage()); mitk::QtPerspectiveItem* pItem = new mitk::QtPerspectiveItem(QString::fromStdString(p->GetLabel())); pItem->m_Perspective = p; pItem->m_Description = QString::fromStdString(p->GetDescription()); std::vector keylist = p->GetKeywordReferences(); pItem->m_Tags = keywordRegistry.GetKeywords(keylist); pItem->setEditable(false); QFont font; font.setBold(true); if (currentPersp.IsNotNull() && currentPersp->GetId()==p->GetId()) pItem->setFont(font); std::vector catPath = p->GetCategoryPath(); if (catPath.empty()) { perspectiveRootItem->appendRow(pItem); } else { QStandardItem* categoryItem = NULL; for (unsigned int c=0; ctext().toStdString() == catPath.front()) { categoryItem = categoryItems.at(c); break; } if (categoryItem==NULL) { categoryItem = new QStandardItem(QIcon(),catPath.front().c_str()); categoryItems.push_back(categoryItem); } categoryItem->setEditable(false); categoryItem->appendRow(pItem); } } std::sort(categoryItems.begin(), categoryItems.end(), compareQStandardItems); for (unsigned int i=0; iappendRow(categoryItems.at(i)); // get all available views berry::IViewRegistry* viewRegistry = berry::PlatformUI::GetWorkbench()->GetViewRegistry(); std::vector viewDescriptors(viewRegistry->GetViews()); std::vector viewParts(page->GetViews()); std::sort(viewDescriptors.begin(), viewDescriptors.end(), compareViews); std::vector viewExcludeList = berry::PlatformUI::GetWorkbench()->GetActiveWorkbenchWindow()->GetViewExcludeList(); QStandardItem* viewRootItem = new QStandardItem(QIcon(),"Candies"); viewRootItem->setEditable(false); treeRootItem->appendRow(viewRootItem); categoryItems.clear(); QStandardItem* noCategoryItem = new QStandardItem(QIcon(),"Miscellaneous"); noCategoryItem->setEditable(false); for (unsigned int i = 0; i < viewDescriptors.size(); ++i) { berry::IViewDescriptor::Pointer v = viewDescriptors[i]; bool skipView = false; for(unsigned int e=0; eGetId()) { skipView = true; break; } if (skipView) continue; std::vector catPath = v->GetCategoryPath(); QIcon* icon = static_cast(v->GetImageDescriptor()->CreateImage()); mitk::QtViewItem* vItem = new mitk::QtViewItem(*icon, QString::fromStdString(v->GetLabel())); vItem->m_View = v; vItem->setToolTip(v->GetDescription().c_str()); vItem->m_Description = QString::fromStdString(v->GetDescription()); std::vector keylist = v->GetKeywordReferences(); vItem->m_Tags = keywordRegistry.GetKeywords(keylist); vItem->setEditable(false); for (unsigned int i=0; iGetPartName()==v->GetLabel()) { QFont font; font.setBold(true); vItem->setFont(font); break; } if (catPath.empty()) noCategoryItem->appendRow(vItem); else { QStandardItem* categoryItem = NULL; for (unsigned int c=0; ctext().toStdString() == catPath.front()) { categoryItem = categoryItems.at(c); break; } if (categoryItem==NULL) { categoryItem = new QStandardItem(QIcon(),catPath.front().c_str()); categoryItems.push_back(categoryItem); } categoryItem->setEditable(false); categoryItem->appendRow(vItem); } } std::sort(categoryItems.begin(), categoryItems.end(), compareQStandardItems); for (unsigned int i=0; iappendRow(categoryItems.at(i)); if (noCategoryItem->hasChildren()) viewRootItem->appendRow(noCategoryItem); m_Controls.m_PluginTreeView->expandAll(); return true; } void QmitkCandyStoreWidget::FilterChanged() { QString filterString = m_Controls.lineEdit->text(); if (filterString.size() > 0 ) m_Controls.m_PluginTreeView->expandAll(); else m_Controls.m_PluginTreeView->collapseAll(); // QRegExp::PatternSyntax syntax = QRegExp::RegExp; Qt::CaseSensitivity caseSensitivity = Qt::CaseInsensitive; QString strPattern = "^*" + filterString; QRegExp regExp(strPattern, caseSensitivity); m_FilterProxyModel->setFilterRegExp(regExp); } void QmitkCandyStoreWidget::ItemClicked(const QModelIndex &index) { QStandardItem* item = m_TreeModel->itemFromIndex(m_FilterProxyModel->mapToSource(index)); if ( dynamic_cast< mitk::QtPerspectiveItem* >(item) ) { try { mitk::QtPerspectiveItem* pItem = dynamic_cast< mitk::QtPerspectiveItem* >(item); berry::PlatformUI::GetWorkbench()->ShowPerspective( pItem->m_Perspective->GetId(), berry::PlatformUI::GetWorkbench()->GetActiveWorkbenchWindow() ); } catch (...) { QMessageBox::critical(0, "Opening Perspective Failed", QString("The requested perspective could not be opened.\nSee the log for details.")); } } else if ( dynamic_cast< mitk::QtViewItem* >(item) ) { berry::IWorkbenchPage::Pointer page = berry::PlatformUI::GetWorkbench()->GetActiveWorkbenchWindow()->GetActivePage(); if (page.IsNotNull()) { try { mitk::QtViewItem* vItem = dynamic_cast< mitk::QtViewItem* >(item); page->ShowView(vItem->m_View->GetId()); } catch (berry::PartInitException e) { BERRY_ERROR << "Error: " << e.displayText() << std::endl; } } } } void QmitkCandyStoreWidget::AddPerspective() { QmitkNewPerspectiveDialog* dialog = new QmitkNewPerspectiveDialog( m_Parent ); int dialogReturnValue = dialog->exec(); if ( dialogReturnValue == QDialog::Rejected ) return; berry::IPerspectiveRegistry* perspRegistry = berry::PlatformUI::GetWorkbench()->GetPerspectiveRegistry(); try { berry::IPerspectiveDescriptor::Pointer perspDesc; perspDesc = perspRegistry->CreatePerspective(dialog->GetPerspectiveName().toStdString(), perspRegistry->FindPerspectiveWithId(perspRegistry->GetDefaultPerspective())); berry::PlatformUI::GetWorkbench()->GetActiveWorkbenchWindow()->GetActivePage()->SetPerspective(perspDesc); } catch(...) { QMessageBox::warning(m_Parent, "Error", "Duplication of selected perspective failed. Please make sure the specified perspective name is not already in use!"); } FillTreeList(); } void QmitkCandyStoreWidget::ClonePerspective() { if (m_RegisteredPerspective.IsNotNull()) { QmitkNewPerspectiveDialog* dialog = new QmitkNewPerspectiveDialog( m_Parent ); QString defaultName(m_RegisteredPerspective->GetLabel().c_str()); defaultName.append(" Copy"); dialog->SetPerspectiveName(defaultName); int dialogReturnValue = dialog->exec(); if ( dialogReturnValue == QDialog::Rejected ) return; berry::IPerspectiveRegistry* perspRegistry = berry::PlatformUI::GetWorkbench()->GetPerspectiveRegistry(); try { berry::IPerspectiveDescriptor::Pointer perspDesc = perspRegistry->ClonePerspective(dialog->GetPerspectiveName().toStdString(), dialog->GetPerspectiveName().toStdString(), m_RegisteredPerspective); berry::PlatformUI::GetWorkbench()->GetActiveWorkbenchWindow()->GetActivePage()->SetPerspective(perspDesc); } catch(...) { QMessageBox::warning(m_Parent, "Error", "Duplication of selected perspective failed. Please make sure the specified perspective name is not already in use!"); } FillTreeList(); } } void QmitkCandyStoreWidget::ResetPerspective() { if (QMessageBox::Yes == QMessageBox(QMessageBox::Question, "Please confirm", "Do you really want to reset the curent perspective?", QMessageBox::Yes|QMessageBox::No).exec()) berry::PlatformUI::GetWorkbench()->GetActiveWorkbenchWindow()->GetActivePage()->ResetPerspective(); } void QmitkCandyStoreWidget::DeletePerspective() { if (m_RegisteredPerspective.IsNotNull()) { QString question = "Do you really want to remove the perspective '"; question.append(m_RegisteredPerspective->GetLabel().c_str()); question.append("'?"); if (QMessageBox::Yes == QMessageBox(QMessageBox::Question, "Please confirm", question, QMessageBox::Yes|QMessageBox::No).exec()) { berry::IPerspectiveRegistry* perspRegistry = berry::PlatformUI::GetWorkbench()->GetPerspectiveRegistry(); perspRegistry->DeletePerspective(m_RegisteredPerspective); berry::PlatformUI::GetWorkbench()->GetActiveWorkbenchWindow()->GetActivePage()->RemovePerspective(m_RegisteredPerspective); FillTreeList(); if (! berry::PlatformUI::GetWorkbench()->GetActiveWorkbenchWindow()->GetActivePage()->GetPerspective()) { berry::IPerspectiveDescriptor::Pointer persp = perspRegistry->FindPerspectiveWithId(perspRegistry->GetDefaultPerspective()); berry::PlatformUI::GetWorkbench()->GetActiveWorkbenchWindow()->GetActivePage()->SetPerspective(persp); } } } } void QmitkCandyStoreWidget::ClosePerspective() { if (QMessageBox::Yes == QMessageBox(QMessageBox::Question, "Please confirm", "Do you really want to close the curent perspective?", QMessageBox::Yes|QMessageBox::No).exec()) { berry::IWorkbenchPage::Pointer page = berry::PlatformUI::GetWorkbench()->GetActiveWorkbenchWindow()->GetActivePage(); page->CloseCurrentPerspective(true, true); // if ( page->GetPerspective().IsNull() ) // { // berry::IPerspectiveRegistry* perspRegistry = berry::PlatformUI::GetWorkbench()->GetPerspectiveRegistry(); // berry::PlatformUI::GetWorkbench()->ShowPerspective( perspRegistry->GetDefaultPerspective(), berry::PlatformUI::GetWorkbench()->GetActiveWorkbenchWindow() ); // } } } void QmitkCandyStoreWidget::CloseAllPerspectives() { if (QMessageBox::Yes == QMessageBox(QMessageBox::Question, "Please confirm", "Do you really want to close all perspectives?", QMessageBox::Yes|QMessageBox::No).exec()) { berry::IWorkbenchPage::Pointer page = berry::PlatformUI::GetWorkbench()->GetActiveWorkbenchWindow()->GetActivePage(); page->CloseAllPerspectives(true, true); // berry::IPerspectiveRegistry* perspRegistry = berry::PlatformUI::GetWorkbench()->GetPerspectiveRegistry(); // berry::PlatformUI::GetWorkbench()->ShowPerspective( perspRegistry->GetDefaultPerspective(), berry::PlatformUI::GetWorkbench()->GetActiveWorkbenchWindow() ); } } void QmitkCandyStoreWidget::ExpandAll() { m_Controls.m_PluginTreeView->expandAll(); } void QmitkCandyStoreWidget::CollapseAll() { m_Controls.m_PluginTreeView->collapseAll(); } void QmitkCandyStoreWidget::CustomMenuRequested(QPoint pos) { QModelIndex index = m_Controls.m_PluginTreeView->indexAt(pos); QStandardItem* item = m_TreeModel->itemFromIndex(m_FilterProxyModel->mapToSource(index)); if (m_ContextMenu==NULL) return; m_ContextMenu->clear(); m_RegisteredPerspective = NULL; QAction* expandAction = new QAction("Expand tree", this); m_ContextMenu->addAction(expandAction); connect(expandAction, SIGNAL(triggered()), SLOT(ExpandAll())); QAction* collapseAction = new QAction("Collapse tree", this); m_ContextMenu->addAction(collapseAction); connect(collapseAction, SIGNAL(triggered()), SLOT(CollapseAll())); m_ContextMenu->addSeparator(); if ( item!=NULL && dynamic_cast< mitk::QtPerspectiveItem* >(item) ) { m_RegisteredPerspective = dynamic_cast< mitk::QtPerspectiveItem* >(item)->m_Perspective; //m_ContextMenu->addSeparator(); QAction* cloneAction = new QAction("Duplicate perspective", this); m_ContextMenu->addAction(cloneAction); connect(cloneAction, SIGNAL(triggered()), SLOT(ClonePerspective())); if (!m_RegisteredPerspective->IsPredefined()) { QAction* deleteAction = new QAction("Remove perspective", this); m_ContextMenu->addAction(deleteAction); connect(deleteAction, SIGNAL(triggered()), SLOT(DeletePerspective())); } m_ContextMenu->addSeparator(); } QAction* resetAction = new QAction("Reset current perspective", this); m_ContextMenu->addAction(resetAction); connect(resetAction, SIGNAL(triggered()), SLOT(ResetPerspective())); QAction* closeAction = new QAction("Close current perspective", this); m_ContextMenu->addAction(closeAction); connect(closeAction, SIGNAL(triggered()), SLOT(ClosePerspective())); m_ContextMenu->addSeparator(); QAction* closeAllAction = new QAction("Close all perspectives", this); m_ContextMenu->addAction(closeAllAction); connect(closeAllAction, SIGNAL(triggered()), SLOT(CloseAllPerspectives())); m_ContextMenu->popup(m_Controls.m_PluginTreeView->viewport()->mapToGlobal(pos)); } diff --git a/Plugins/org.mitk.gui.qt.ext/src/QmitkCandyStoreWidget.h b/Plugins/org.mitk.gui.qt.candystore/src/QmitkCandyStoreWidget.h similarity index 93% rename from Plugins/org.mitk.gui.qt.ext/src/QmitkCandyStoreWidget.h rename to Plugins/org.mitk.gui.qt.candystore/src/QmitkCandyStoreWidget.h index 995ea9ca94..509c4cdad6 100644 --- a/Plugins/org.mitk.gui.qt.ext/src/QmitkCandyStoreWidget.h +++ b/Plugins/org.mitk.gui.qt.candystore/src/QmitkCandyStoreWidget.h @@ -1,88 +1,89 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef _QMITKCandyStoreWidget_H_INCLUDED #define _QMITKCandyStoreWidget_H_INCLUDED //QT headers #include #include + +#include #include "ui_QmitkCandyStoreWidgetControls.h" #include #include #include #include #include #include #include #include #include #include #include class ClassFilterProxyModel; /** @brief */ class QmitkCandyStoreWidget : public QWidget { //this is needed for all Qt objects that should have a MOC object (everything that derives from QObject) Q_OBJECT public: QmitkCandyStoreWidget (QWidget* parent = 0, Qt::WindowFlags f = 0); virtual ~QmitkCandyStoreWidget(); virtual void CreateQtPartControl(QWidget *parent); bool FillTreeList(); void UpdateTreeList(QStandardItem* item = NULL, berry::IWorkbenchPartReference* partRef=NULL, const std::string& changeId=""); - berry::IPerspectiveListener::Pointer m_PerspectiveListener; + berry::IPerspectiveListener::Pointer m_PerspectiveListener; + berry::IWindowListener::Pointer m_WindowListener; public slots: void CustomMenuRequested(QPoint pos); void ItemClicked(const QModelIndex &index); void AddPerspective(); void ClonePerspective(); void ResetPerspective(); void DeletePerspective(); void CloseAllPerspectives(); void ClosePerspective(); void ExpandAll(); void CollapseAll(); void FilterChanged(); protected: // member variables Ui::QmitkCandyStoreWidgetControls m_Controls; QWidget* m_Parent; QStandardItemModel* m_TreeModel; ClassFilterProxyModel* m_FilterProxyModel; QMenu* m_ContextMenu; berry::IPerspectiveDescriptor::Pointer m_RegisteredPerspective; - berry::IWindowListener::Pointer m_WindowListener; - private: }; #endif // _QMITKCandyStoreWidget_H_INCLUDED diff --git a/Plugins/org.mitk.gui.qt.ext/src/QmitkCandyStoreWidgetControls.ui b/Plugins/org.mitk.gui.qt.candystore/src/QmitkCandyStoreWidgetControls.ui similarity index 100% rename from Plugins/org.mitk.gui.qt.ext/src/QmitkCandyStoreWidgetControls.ui rename to Plugins/org.mitk.gui.qt.candystore/src/QmitkCandyStoreWidgetControls.ui diff --git a/Plugins/org.mitk.gui.qt.ext/src/QmitkNewPerspectiveDialog.cpp b/Plugins/org.mitk.gui.qt.candystore/src/QmitkNewPerspectiveDialog.cpp similarity index 100% rename from Plugins/org.mitk.gui.qt.ext/src/QmitkNewPerspectiveDialog.cpp rename to Plugins/org.mitk.gui.qt.candystore/src/QmitkNewPerspectiveDialog.cpp diff --git a/Plugins/org.mitk.gui.qt.ext/src/QmitkNewPerspectiveDialog.h b/Plugins/org.mitk.gui.qt.candystore/src/QmitkNewPerspectiveDialog.h similarity index 100% rename from Plugins/org.mitk.gui.qt.ext/src/QmitkNewPerspectiveDialog.h rename to Plugins/org.mitk.gui.qt.candystore/src/QmitkNewPerspectiveDialog.h diff --git a/Plugins/org.mitk.gui.qt.candystore/src/internal/CandyStoreView.cpp b/Plugins/org.mitk.gui.qt.candystore/src/internal/CandyStoreView.cpp new file mode 100644 index 0000000000..1ad53d1f97 --- /dev/null +++ b/Plugins/org.mitk.gui.qt.candystore/src/internal/CandyStoreView.cpp @@ -0,0 +1,57 @@ +/*=================================================================== + +The Medical Imaging Interaction Toolkit (MITK) + +Copyright (c) German Cancer Research Center, +Division of Medical and Biological Informatics. +All rights reserved. + +This software is distributed WITHOUT ANY WARRANTY; without +even the implied warranty of MERCHANTABILITY or FITNESS FOR +A PARTICULAR PURPOSE. + +See LICENSE.txt or http://www.mitk.org for details. + +===================================================================*/ + + +// Blueberry +#include +#include + +// Qmitk +#include "CandyStoreView.h" + +// Qt +#include + +//mitk image +#include + +const std::string CandyStoreView::VIEW_ID = "org.mitk.views.candystoreview"; + +void CandyStoreView::SetFocus() +{ + +} + +void CandyStoreView::CreateQtPartControl( QWidget *parent ) +{ + // create GUI widgets from the Qt Designer's .ui file + m_Controls.setupUi( parent ); + + + +// candyStore = new QDockWidget("Candy Store"); +// candyStore->setWidget(new QmitkCandyStoreWidget()); +// candyStore->setFeatures(QDockWidget::DockWidgetMovable | QDockWidget::DockWidgetFloatable); +// candyStore->setVisible(false); +// candyStore->setObjectName("Candy Store"); +// mainWindow->addDockWidget(Qt::LeftDockWidgetArea, candyStore); +} + +void CandyStoreView::OnSelectionChanged( berry::IWorkbenchPart::Pointer /*source*/, + const QList& nodes ) +{ + +} diff --git a/Plugins/org.mitk.gui.qt.candystore/src/internal/CandyStoreView.h b/Plugins/org.mitk.gui.qt.candystore/src/internal/CandyStoreView.h new file mode 100644 index 0000000000..2b49dc9247 --- /dev/null +++ b/Plugins/org.mitk.gui.qt.candystore/src/internal/CandyStoreView.h @@ -0,0 +1,64 @@ +/*=================================================================== + +The Medical Imaging Interaction Toolkit (MITK) + +Copyright (c) German Cancer Research Center, +Division of Medical and Biological Informatics. +All rights reserved. + +This software is distributed WITHOUT ANY WARRANTY; without +even the implied warranty of MERCHANTABILITY or FITNESS FOR +A PARTICULAR PURPOSE. + +See LICENSE.txt or http://www.mitk.org for details. + +===================================================================*/ + + +#ifndef CandyStoreView_h +#define CandyStoreView_h + +#include +#include +#include + +#include "ui_CandyStoreViewControls.h" + + +/** + \brief CandyStoreView + + \warning This class is not yet documented. Use "git blame" and ask the author to provide basic documentation. + + \sa QmitkAbstractView + \ingroup ${plugin_target}_internal +*/ +class CandyStoreView : public QmitkAbstractView +{ + // this is needed for all Qt objects that should have a Qt meta-object + // (everything that derives from QObject and wants to have signal/slots) + Q_OBJECT + + public: + + static const std::string VIEW_ID; + + protected slots: + + /// \brief Called when the user clicks the GUI button + + protected: + + virtual void CreateQtPartControl(QWidget *parent); + + virtual void SetFocus(); + + /// \brief called by QmitkFunctionality when DataManager's selection has changed + virtual void OnSelectionChanged( berry::IWorkbenchPart::Pointer source, + const QList& nodes ); + + Ui::CandyStoreViewControls m_Controls; + +}; + +#endif // CandyStoreView_h diff --git a/Plugins/org.mitk.gui.qt.candystore/src/internal/CandyStoreViewControls.ui b/Plugins/org.mitk.gui.qt.candystore/src/internal/CandyStoreViewControls.ui new file mode 100644 index 0000000000..4d663835b9 --- /dev/null +++ b/Plugins/org.mitk.gui.qt.candystore/src/internal/CandyStoreViewControls.ui @@ -0,0 +1,54 @@ + + + CandyStoreViewControls + + + + 0 + 0 + 222 + 161 + + + + + 0 + 0 + + + + QmitkTemplate + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + + + + QmitkCandyStoreWidget + QWidget +
QmitkCandyStoreWidget.h
+ 1 +
+
+ + +
diff --git a/Plugins/org.mitk.gui.qt.diffusionimagingapp/src/internal/Perspectives/QmitkDIAppUtilityPerspective.h b/Plugins/org.mitk.gui.qt.candystore/src/internal/org_mitk_gui_qt_candystore_Activator.cpp similarity index 52% rename from Plugins/org.mitk.gui.qt.diffusionimagingapp/src/internal/Perspectives/QmitkDIAppUtilityPerspective.h rename to Plugins/org.mitk.gui.qt.candystore/src/internal/org_mitk_gui_qt_candystore_Activator.cpp index 7ed2466fe8..cd04f1c6e5 100644 --- a/Plugins/org.mitk.gui.qt.diffusionimagingapp/src/internal/Perspectives/QmitkDIAppUtilityPerspective.h +++ b/Plugins/org.mitk.gui.qt.candystore/src/internal/org_mitk_gui_qt_candystore_Activator.cpp @@ -1,36 +1,38 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ -#ifndef QmitkDIAppUtilityPerspective_H_ -#define QmitkDIAppUtilityPerspective_H_ +#include "org_mitk_gui_qt_candystore_Activator.h" -#include +#include -class QmitkDIAppUtilityPerspective : public QObject, public berry::IPerspectiveFactory -{ - Q_OBJECT - Q_INTERFACES(berry::IPerspectiveFactory) +#include "CandyStoreView.h" + +namespace mitk { -public: +void org_mitk_gui_qt_candystore_Activator::start(ctkPluginContext* context) +{ + BERRY_REGISTER_EXTENSION_CLASS(CandyStoreView, context) +} - QmitkDIAppUtilityPerspective() {} - ~QmitkDIAppUtilityPerspective() {} +void org_mitk_gui_qt_candystore_Activator::stop(ctkPluginContext* context) +{ + Q_UNUSED(context) +} - void CreateInitialLayout(berry::IPageLayout::Pointer layout); -}; +} -#endif /* QmitkDIAppUtilityPerspective_H_ */ +Q_EXPORT_PLUGIN2(org_mitk_gui_qt_candystore, mitk::org_mitk_gui_qt_candystore_Activator) diff --git a/Plugins/org.mitk.gui.qt.diffusionimagingapp/src/internal/Perspectives/QmitkDIAppTBSSPerspective.h b/Plugins/org.mitk.gui.qt.candystore/src/internal/org_mitk_gui_qt_candystore_Activator.h similarity index 54% rename from Plugins/org.mitk.gui.qt.diffusionimagingapp/src/internal/Perspectives/QmitkDIAppTBSSPerspective.h rename to Plugins/org.mitk.gui.qt.candystore/src/internal/org_mitk_gui_qt_candystore_Activator.h index d2eaf5ccf0..d97e38fc8f 100644 --- a/Plugins/org.mitk.gui.qt.diffusionimagingapp/src/internal/Perspectives/QmitkDIAppTBSSPerspective.h +++ b/Plugins/org.mitk.gui.qt.candystore/src/internal/org_mitk_gui_qt_candystore_Activator.h @@ -1,36 +1,40 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ -#ifndef QmitkDIAppTBSSPerspective_H_ -#define QmitkDIAppTBSSPerspective_H_ +#ifndef org_mitk_gui_qt_candystore_Activator_h +#define org_mitk_gui_qt_candystore_Activator_h -#include +#include -class QmitkDIAppTBSSPerspective : public QObject, public berry::IPerspectiveFactory +namespace mitk { + +class org_mitk_gui_qt_candystore_Activator : + public QObject, public ctkPluginActivator { Q_OBJECT - Q_INTERFACES(berry::IPerspectiveFactory) + Q_INTERFACES(ctkPluginActivator) public: - QmitkDIAppTBSSPerspective() {} - ~QmitkDIAppTBSSPerspective() {} + void start(ctkPluginContext* context); + void stop(ctkPluginContext* context); + +}; // org_mitk_gui_qt_candystore_Activator - void CreateInitialLayout(berry::IPageLayout::Pointer layout); -}; +} -#endif /* QmitkDIAppTBSSPerspective_H_ */ +#endif // org_mitk_gui_qt_candystore_Activator_h diff --git a/Plugins/org.mitk.gui.qt.ext/src/mitkQtPerspectiveItem.h b/Plugins/org.mitk.gui.qt.candystore/src/mitkQtPerspectiveItem.h similarity index 100% rename from Plugins/org.mitk.gui.qt.ext/src/mitkQtPerspectiveItem.h rename to Plugins/org.mitk.gui.qt.candystore/src/mitkQtPerspectiveItem.h diff --git a/Plugins/org.mitk.gui.qt.ext/src/mitkQtViewItem.h b/Plugins/org.mitk.gui.qt.candystore/src/mitkQtViewItem.h similarity index 100% rename from Plugins/org.mitk.gui.qt.ext/src/mitkQtViewItem.h rename to Plugins/org.mitk.gui.qt.candystore/src/mitkQtViewItem.h diff --git a/Plugins/org.mitk.gui.qt.diffusionimaging/files.cmake b/Plugins/org.mitk.gui.qt.diffusionimaging/files.cmake index 12233dbd7d..fac0d3407c 100644 --- a/Plugins/org.mitk.gui.qt.diffusionimaging/files.cmake +++ b/Plugins/org.mitk.gui.qt.diffusionimaging/files.cmake @@ -1,181 +1,198 @@ set(SRC_CPP_FILES QmitkODFDetailsWidget.cpp QmitkODFRenderWidget.cpp QmitkPartialVolumeAnalysisWidget.cpp QmitkIVIMWidget.cpp QmitkTbssRoiAnalysisWidget.cpp QmitkResidualAnalysisWidget.cpp QmitkResidualViewWidget.cpp QmitkTensorModelParametersWidget.cpp QmitkZeppelinModelParametersWidget.cpp QmitkStickModelParametersWidget.cpp QmitkDotModelParametersWidget.cpp QmitkBallModelParametersWidget.cpp QmitkAstrosticksModelParametersWidget.cpp ) set(INTERNAL_CPP_FILES mitkPluginActivator.cpp QmitkQBallReconstructionView.cpp QmitkPreprocessingView.cpp QmitkDiffusionDicomImportView.cpp QmitkDiffusionQuantificationView.cpp QmitkTensorReconstructionView.cpp - QmitkDiffusionImagingPublicPerspective.cpp QmitkControlVisualizationPropertiesView.cpp QmitkODFDetailsView.cpp QmitkGibbsTrackingView.cpp QmitkStochasticFiberTrackingView.cpp QmitkStreamlineTrackingView.cpp QmitkFiberProcessingView.cpp # QmitkFiberBundleDeveloperView.cpp QmitkPartialVolumeAnalysisView.cpp QmitkIVIMView.cpp QmitkTractbasedSpatialStatisticsView.cpp QmitkTbssTableModel.cpp QmitkTbssMetaTableModel.cpp QmitkTbssSkeletonizationView.cpp Connectomics/QmitkConnectomicsDataView.cpp Connectomics/QmitkConnectomicsNetworkOperationsView.cpp Connectomics/QmitkConnectomicsStatisticsView.cpp Connectomics/QmitkNetworkHistogramCanvas.cpp QmitkDwiSoftwarePhantomView.cpp QmitkOdfMaximaExtractionView.cpp QmitkFiberfoxView.cpp QmitkFiberExtractionView.cpp QmitkFieldmapGeneratorView.cpp QmitkDiffusionRegistrationView.cpp QmitkDenoisingView.cpp + + Perspectives/QmitkFiberProcessingPerspective.cpp + Perspectives/QmitkDiffusionImagingAppPerspective.cpp + Perspectives/QmitkGibbsTractographyPerspective.cpp + Perspectives/QmitkStreamlineTractographyPerspective.cpp + Perspectives/QmitkProbabilisticTractographyPerspective.cpp + Perspectives/QmitkDIAppSyntheticDataGenerationPerspective.cpp + Perspectives/QmitkDIAppIVIMPerspective.cpp ) set(UI_FILES src/internal/QmitkQBallReconstructionViewControls.ui src/internal/QmitkPreprocessingViewControls.ui src/internal/QmitkDiffusionDicomImportViewControls.ui src/internal/QmitkDiffusionQuantificationViewControls.ui src/internal/QmitkTensorReconstructionViewControls.ui src/internal/QmitkControlVisualizationPropertiesViewControls.ui src/internal/QmitkODFDetailsViewControls.ui src/internal/QmitkGibbsTrackingViewControls.ui src/internal/QmitkStochasticFiberTrackingViewControls.ui src/internal/QmitkStreamlineTrackingViewControls.ui src/internal/QmitkFiberProcessingViewControls.ui # src/internal/QmitkFiberBundleDeveloperViewControls.ui src/internal/QmitkPartialVolumeAnalysisViewControls.ui src/internal/QmitkIVIMViewControls.ui src/internal/QmitkTractbasedSpatialStatisticsViewControls.ui src/internal/QmitkTbssSkeletonizationViewControls.ui src/internal/Connectomics/QmitkConnectomicsDataViewControls.ui src/internal/Connectomics/QmitkConnectomicsNetworkOperationsViewControls.ui src/internal/Connectomics/QmitkConnectomicsStatisticsViewControls.ui src/internal/QmitkDwiSoftwarePhantomViewControls.ui src/internal/QmitkOdfMaximaExtractionViewControls.ui src/internal/QmitkFiberfoxViewControls.ui src/internal/QmitkFiberExtractionViewControls.ui src/QmitkTensorModelParametersWidgetControls.ui src/QmitkZeppelinModelParametersWidgetControls.ui src/QmitkStickModelParametersWidgetControls.ui src/QmitkDotModelParametersWidgetControls.ui src/QmitkBallModelParametersWidgetControls.ui src/QmitkAstrosticksModelParametersWidgetControls.ui src/internal/QmitkFieldmapGeneratorViewControls.ui src/internal/QmitkDiffusionRegistrationViewControls.ui src/internal/QmitkDenoisingViewControls.ui ) set(MOC_H_FILES src/internal/mitkPluginActivator.h src/internal/QmitkQBallReconstructionView.h src/internal/QmitkPreprocessingView.h src/internal/QmitkDiffusionDicomImportView.h - src/internal/QmitkDiffusionImagingPublicPerspective.h src/internal/QmitkDiffusionQuantificationView.h src/internal/QmitkTensorReconstructionView.h src/internal/QmitkControlVisualizationPropertiesView.h src/internal/QmitkODFDetailsView.h src/QmitkODFRenderWidget.h src/QmitkODFDetailsWidget.h src/internal/QmitkGibbsTrackingView.h src/internal/QmitkStochasticFiberTrackingView.h src/internal/QmitkStreamlineTrackingView.h src/internal/QmitkFiberProcessingView.h # src/internal/QmitkFiberBundleDeveloperView.h src/internal/QmitkPartialVolumeAnalysisView.h src/QmitkPartialVolumeAnalysisWidget.h src/internal/QmitkIVIMView.h src/internal/QmitkTractbasedSpatialStatisticsView.h src/internal/QmitkTbssSkeletonizationView.h src/QmitkTbssRoiAnalysisWidget.h src/QmitkResidualAnalysisWidget.h src/QmitkResidualViewWidget.h src/internal/Connectomics/QmitkConnectomicsDataView.h src/internal/Connectomics/QmitkConnectomicsNetworkOperationsView.h src/internal/Connectomics/QmitkConnectomicsStatisticsView.h src/internal/Connectomics/QmitkNetworkHistogramCanvas.h src/internal/QmitkDwiSoftwarePhantomView.h src/internal/QmitkOdfMaximaExtractionView.h src/internal/QmitkFiberfoxView.h src/internal/QmitkFiberExtractionView.h src/QmitkTensorModelParametersWidget.h src/QmitkZeppelinModelParametersWidget.h src/QmitkStickModelParametersWidget.h src/QmitkDotModelParametersWidget.h src/QmitkBallModelParametersWidget.h src/QmitkAstrosticksModelParametersWidget.h src/internal/QmitkFieldmapGeneratorView.h src/internal/QmitkDiffusionRegistrationView.h src/internal/QmitkDenoisingView.h + + src/internal/Perspectives/QmitkFiberProcessingPerspective.h + src/internal/Perspectives/QmitkDiffusionImagingAppPerspective.h + src/internal/Perspectives/QmitkGibbsTractographyPerspective.h + src/internal/Perspectives/QmitkStreamlineTractographyPerspective.h + src/internal/Perspectives/QmitkProbabilisticTractographyPerspective.h + src/internal/Perspectives/QmitkDIAppSyntheticDataGenerationPerspective.h + src/internal/Perspectives/QmitkDIAppIVIMPerspective.h ) set(CACHED_RESOURCE_FILES # list of resource files which can be used by the plug-in # system without loading the plug-ins shared library, # for example the icon used in the menu and tabs for the # plug-in views in the workbench plugin.xml resources/preprocessing.png resources/dwiimport.png resources/quantification.png resources/reconodf.png resources/recontensor.png resources/vizControls.png resources/OdfDetails.png resources/GibbsTracking.png resources/FiberBundleOperations.png resources/PartialVolumeAnalysis_24.png resources/IVIM_48.png resources/stochFB.png resources/tbss.png resources/connectomics/QmitkConnectomicsDataViewIcon_48.png resources/connectomics/QmitkConnectomicsNetworkOperationsViewIcon_48.png resources/connectomics/QmitkConnectomicsStatisticsViewIcon_48.png resources/arrow.png resources/qball_peaks.png resources/phantom.png resources/tensor.png resources/qball.png resources/StreamlineTracking.png resources/dwi2.png resources/odf.png resources/refresh.xpm resources/diffusionregistration.png resources/denoisingicon.png + resources/syntheticdata.png + resources/ivim.png + resources/tractography.png ) set(QRC_FILES # uncomment the following line if you want to use Qt resources resources/QmitkDiffusionImaging.qrc #resources/QmitkTractbasedSpatialStatisticsView.qrc ) set(CPP_FILES ) foreach(file ${SRC_CPP_FILES}) set(CPP_FILES ${CPP_FILES} src/${file}) endforeach(file ${SRC_CPP_FILES}) foreach(file ${INTERNAL_CPP_FILES}) set(CPP_FILES ${CPP_FILES} src/internal/${file}) endforeach(file ${INTERNAL_CPP_FILES}) diff --git a/Plugins/org.mitk.gui.qt.diffusionimaging/plugin.xml b/Plugins/org.mitk.gui.qt.diffusionimaging/plugin.xml index b62e7906c4..20df4d3404 100644 --- a/Plugins/org.mitk.gui.qt.diffusionimaging/plugin.xml +++ b/Plugins/org.mitk.gui.qt.diffusionimaging/plugin.xml @@ -1,188 +1,351 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + name="Q-Balls" + category="Signal modeling" + icon="resources/qball.png" + class="QmitkQBallReconstructionView"> Q-Ball reconstruction view + name="DICOM Import" + category="Data handling" + class="QmitkDiffusionDicomImport" + icon="resources/dwiimport.png"> Diffusion DICOM data import + name="Preprocessing" + category="Preprocessing" + class="QmitkPreprocessingView" + icon="resources/dwi2.png"> + + + name="Scalar Indices" + category="Quantification" + class="QmitkDiffusionQuantificationView" + icon="resources/quantification.png"> + Calculation of tensor and Q-ball derived measures. + + + name="Tensors" + category="Signal modeling" + icon="resources/tensor.png" + class="QmitkTensorReconstructionView"> + + + name="Visualization" + icon="resources/vizControls.png" + class="QmitkControlVisualizationPropertiesView"> + + + name="IVIM" + category="Quantification" + class="QmitkIVIMView" + icon="resources/IVIM_48.png"> + + + name="ODF Details" + category="Quantification" + class="QmitkODFDetailsView" + icon="resources/OdfDetails.png"> + + + name="Gibbs Tracking" + category="Fiber tractography" + class="QmitkGibbsTrackingView" + icon="resources/GibbsTracking.png"> + + + name="Stochastic Tracking" + category="Fiber tractography" + class="QmitkStochasticFiberTrackingView" + icon="resources/stochFB.png"> + + + name="Streamline Tracking" + category="Fiber tractography" + class="QmitkStreamlineTrackingView" + icon="resources/StreamlineTracking.png"> + + + name="Fiber Processing" + category="Fiber processing" + class="QmitkFiberProcessingView" + icon="resources/FiberBundleOperations.png"> + + + name="Fiber Extraction" + category="Fiber processing" + class="QmitkFiberExtractionView" + icon="resources/FiberBundleOperations.png"> + + + name="PV Analysis" + category="Quantification" + class="QmitkPartialVolumeAnalysisView" + icon="resources/PartialVolumeAnalysis_24.png"> + + + name="Tbss Skeletonization" + category="Quantification" + class="QmitkTbssSkeletonizationView" + icon="resources/tbss.png"> + + + name="Tract-based spatial statistics" + category="Quantification" + class="QmitkTractbasedSpatialStatisticsView" + icon="resources/tbss.png"> + + + name="Network Operations" + category="Connectomics" + class="QmitkConnectomicsNetworkOperationsView" + icon="resources/connectomics/QmitkConnectomicsNetworkOperationsViewIcon_48.png"> + + + name="Network Data" + category="Connectomics" + class="QmitkConnectomicsDataView" + icon="resources/connectomics/QmitkConnectomicsDataViewIcon_48.png"> + + + name="Network Statistics" + category="Connectomics" + class="QmitkConnectomicsStatisticsView" + icon="resources/connectomics/QmitkConnectomicsStatisticsViewIcon_48.png"> + + + name="Peak Extraction" + category="Signal modeling" + class="QmitkOdfMaximaExtractionView" + icon="resources/qball_peaks.png"> + + + name="Fiberfox" + category="Simulated data" + class="QmitkFiberfoxView" + icon="resources/phantom.png"> + Diffusion weighted MRI data simulation tool. + + + name="Fieldmap Generator" + category="Simulated data" + class="QmitkFieldmapGeneratorView" + icon="resources/odf.png"> + + + name="DWI Registration" + category="Registration" + class="QmitkDiffusionRegistrationView" + icon="resources/diffusionregistration.png"> + + - + name="DWI Denoising" + category="Preprocessing" + class="QmitkDenoisingView" + icon="resources/denoisingicon.png"> + + + - - This is a short information about this perspective - + + + This persective contains all views necessary to postprocess fibers. + + + + + + + + + + + + + + + + + + + + + + diff --git a/Plugins/org.mitk.gui.qt.diffusionimagingapp/resources/perspectives/ivim.png b/Plugins/org.mitk.gui.qt.diffusionimaging/resources/ivim.png similarity index 100% rename from Plugins/org.mitk.gui.qt.diffusionimagingapp/resources/perspectives/ivim.png rename to Plugins/org.mitk.gui.qt.diffusionimaging/resources/ivim.png diff --git a/Plugins/org.mitk.gui.qt.diffusionimagingapp/resources/perspectives/syntheticdata.png b/Plugins/org.mitk.gui.qt.diffusionimaging/resources/syntheticdata.png similarity index 100% rename from Plugins/org.mitk.gui.qt.diffusionimagingapp/resources/perspectives/syntheticdata.png rename to Plugins/org.mitk.gui.qt.diffusionimaging/resources/syntheticdata.png diff --git a/Plugins/org.mitk.gui.qt.diffusionimagingapp/resources/perspectives/tractography.png b/Plugins/org.mitk.gui.qt.diffusionimaging/resources/tractography.png similarity index 100% rename from Plugins/org.mitk.gui.qt.diffusionimagingapp/resources/perspectives/tractography.png rename to Plugins/org.mitk.gui.qt.diffusionimaging/resources/tractography.png diff --git a/Plugins/org.mitk.gui.qt.diffusionimaging/src/internal/Perspectives/QmitkDIAppIVIMPerspective.cpp b/Plugins/org.mitk.gui.qt.diffusionimaging/src/internal/Perspectives/QmitkDIAppIVIMPerspective.cpp new file mode 100644 index 0000000000..c8c7a36884 --- /dev/null +++ b/Plugins/org.mitk.gui.qt.diffusionimaging/src/internal/Perspectives/QmitkDIAppIVIMPerspective.cpp @@ -0,0 +1,52 @@ +/*=================================================================== + +The Medical Imaging Interaction Toolkit (MITK) + +Copyright (c) German Cancer Research Center, +Division of Medical and Biological Informatics. +All rights reserved. + +This software is distributed WITHOUT ANY WARRANTY; without +even the implied warranty of MERCHANTABILITY or FITNESS FOR +A PARTICULAR PURPOSE. + +See LICENSE.txt or http://www.mitk.org for details. + +===================================================================*/ + +#include "QmitkDIAppIVIMPerspective.h" +#include "berryIViewLayout.h" + +void QmitkDIAppIVIMPerspective::CreateInitialLayout(berry::IPageLayout::Pointer layout) +{ + ///////////////////////////////////////////////////// + // all di-app perspectives should have the following: + ///////////////////////////////////////////////////// + + std::string editorArea = layout->GetEditorArea(); + + layout->AddStandaloneView("org.mitk.views.datamanager", + false, berry::IPageLayout::LEFT, 0.3f, editorArea); + + layout->AddStandaloneView("org.mitk.views.controlvisualizationpropertiesview", + false, berry::IPageLayout::BOTTOM, .15f, "org.mitk.views.datamanager"); + + berry::IFolderLayout::Pointer left = + layout->CreateFolder("org.mbi.diffusionimaginginternal.leftcontrols", + berry::IPageLayout::BOTTOM, 0.1f, "org.mitk.views.controlvisualizationpropertiesview"); + + layout->AddStandaloneViewPlaceholder("org.mitk.views.imagenavigator", + berry::IPageLayout::BOTTOM, .7f, "org.mbi.diffusionimaginginternal.leftcontrols", false); + + ///////////////////////////////////////////// + // here goes the perspective specific stuff + ///////////////////////////////////////////// + + left->AddView("org.mitk.views.ivim"); + berry::IViewLayout::Pointer lo = layout->GetViewLayout("org.mitk.views.ivim"); + + + left->AddView("org.mitk.views.segmentation"); + lo = layout->GetViewLayout("org.mitk.views.segmentation"); + +} diff --git a/Plugins/org.mitk.gui.qt.diffusionimagingapp/src/internal/Perspectives/QmitkDIAppIVIMPerspective.h b/Plugins/org.mitk.gui.qt.diffusionimaging/src/internal/Perspectives/QmitkDIAppIVIMPerspective.h similarity index 100% rename from Plugins/org.mitk.gui.qt.diffusionimagingapp/src/internal/Perspectives/QmitkDIAppIVIMPerspective.h rename to Plugins/org.mitk.gui.qt.diffusionimaging/src/internal/Perspectives/QmitkDIAppIVIMPerspective.h diff --git a/Plugins/org.mitk.gui.qt.diffusionimaging/src/internal/Perspectives/QmitkDIAppSyntheticDataGenerationPerspective.cpp b/Plugins/org.mitk.gui.qt.diffusionimaging/src/internal/Perspectives/QmitkDIAppSyntheticDataGenerationPerspective.cpp new file mode 100644 index 0000000000..539f7c6071 --- /dev/null +++ b/Plugins/org.mitk.gui.qt.diffusionimaging/src/internal/Perspectives/QmitkDIAppSyntheticDataGenerationPerspective.cpp @@ -0,0 +1,49 @@ +/*=================================================================== + +The Medical Imaging Interaction Toolkit (MITK) + +Copyright (c) German Cancer Research Center, +Division of Medical and Biological Informatics. +All rights reserved. + +This software is distributed WITHOUT ANY WARRANTY; without +even the implied warranty of MERCHANTABILITY or FITNESS FOR +A PARTICULAR PURPOSE. + +See LICENSE.txt or http://www.mitk.org for details. + +===================================================================*/ + +#include "QmitkDIAppSyntheticDataGenerationPerspective.h" +#include "berryIViewLayout.h" + +void QmitkDIAppSyntheticDataGenerationPerspective::CreateInitialLayout(berry::IPageLayout::Pointer layout) +{ + ///////////////////////////////////////////////////// + // all di-app perspectives should have the following: + ///////////////////////////////////////////////////// + + std::string editorArea = layout->GetEditorArea(); + + layout->AddStandaloneView("org.mitk.views.datamanager", + false, berry::IPageLayout::LEFT, 0.3f, editorArea); + + layout->AddStandaloneView("org.mitk.views.controlvisualizationpropertiesview", + false, berry::IPageLayout::BOTTOM, .15f, "org.mitk.views.datamanager"); + + berry::IFolderLayout::Pointer left = + layout->CreateFolder("org.mbi.diffusionimaginginternal.leftcontrols", + berry::IPageLayout::BOTTOM, 0.1f, "org.mitk.views.controlvisualizationpropertiesview"); + + layout->AddStandaloneViewPlaceholder("org.mitk.views.imagenavigator", + berry::IPageLayout::BOTTOM, .7f, "org.mbi.diffusionimaginginternal.leftcontrols", false); + + ///////////////////////////////////////////// + // here goes the perspective specific stuff + ///////////////////////////////////////////// + + left->AddView("org.mitk.views.fiberfoxview"); + left->AddView("org.mitk.views.fieldmapgenerator"); + left->AddView("org.mitk.views.segmentation"); + +} diff --git a/Plugins/org.mitk.gui.qt.diffusionimagingapp/src/internal/Perspectives/QmitkDIAppSyntheticDataGenerationPerspective.h b/Plugins/org.mitk.gui.qt.diffusionimaging/src/internal/Perspectives/QmitkDIAppSyntheticDataGenerationPerspective.h similarity index 100% rename from Plugins/org.mitk.gui.qt.diffusionimagingapp/src/internal/Perspectives/QmitkDIAppSyntheticDataGenerationPerspective.h rename to Plugins/org.mitk.gui.qt.diffusionimaging/src/internal/Perspectives/QmitkDIAppSyntheticDataGenerationPerspective.h diff --git a/Plugins/org.mitk.gui.qt.diffusionimaging/src/internal/Perspectives/QmitkDiffusionImagingAppPerspective.cpp b/Plugins/org.mitk.gui.qt.diffusionimaging/src/internal/Perspectives/QmitkDiffusionImagingAppPerspective.cpp new file mode 100644 index 0000000000..0940e90969 --- /dev/null +++ b/Plugins/org.mitk.gui.qt.diffusionimaging/src/internal/Perspectives/QmitkDiffusionImagingAppPerspective.cpp @@ -0,0 +1,44 @@ +/*=================================================================== + +The Medical Imaging Interaction Toolkit (MITK) + +Copyright (c) German Cancer Research Center, +Division of Medical and Biological Informatics. +All rights reserved. + +This software is distributed WITHOUT ANY WARRANTY; without +even the implied warranty of MERCHANTABILITY or FITNESS FOR +A PARTICULAR PURPOSE. + +See LICENSE.txt or http://www.mitk.org for details. + +===================================================================*/ + +#include "QmitkDiffusionImagingAppPerspective.h" +#include "berryIViewLayout.h" + +void QmitkDiffusionImagingAppPerspective::CreateInitialLayout(berry::IPageLayout::Pointer layout) +{ + ///////////////////////////////////////////////////// + // all di-app perspectives should have the following: + ///////////////////////////////////////////////////// + + std::string editorArea = layout->GetEditorArea(); + + layout->AddStandaloneView("org.mitk.views.datamanager", + false, berry::IPageLayout::LEFT, 0.3f, editorArea); + + layout->AddStandaloneView("org.mitk.views.controlvisualizationpropertiesview", + false, berry::IPageLayout::BOTTOM, .15f, "org.mitk.views.datamanager"); + + berry::IFolderLayout::Pointer left = + layout->CreateFolder("org.mbi.diffusionimaginginternal.leftcontrols", + berry::IPageLayout::BOTTOM, 0.1f, "org.mitk.views.controlvisualizationpropertiesview"); + + layout->AddStandaloneViewPlaceholder("org.mitk.views.imagenavigator", + berry::IPageLayout::BOTTOM, .7f, "org.mbi.diffusionimaginginternal.leftcontrols", false); + + ///////////////////////////////////////////// + // here goes the perspective specific stuff + ///////////////////////////////////////////// +} diff --git a/Plugins/org.mitk.gui.qt.diffusionimagingapp/src/internal/Perspectives/QmitkDiffusionImagingAppPerspective.h b/Plugins/org.mitk.gui.qt.diffusionimaging/src/internal/Perspectives/QmitkDiffusionImagingAppPerspective.h similarity index 100% rename from Plugins/org.mitk.gui.qt.diffusionimagingapp/src/internal/Perspectives/QmitkDiffusionImagingAppPerspective.h rename to Plugins/org.mitk.gui.qt.diffusionimaging/src/internal/Perspectives/QmitkDiffusionImagingAppPerspective.h diff --git a/Plugins/org.mitk.gui.qt.diffusionimaging/src/internal/Perspectives/QmitkFiberProcessingPerspective.cpp b/Plugins/org.mitk.gui.qt.diffusionimaging/src/internal/Perspectives/QmitkFiberProcessingPerspective.cpp new file mode 100644 index 0000000000..34bdcb1b3b --- /dev/null +++ b/Plugins/org.mitk.gui.qt.diffusionimaging/src/internal/Perspectives/QmitkFiberProcessingPerspective.cpp @@ -0,0 +1,57 @@ +/*=================================================================== + +The Medical Imaging Interaction Toolkit (MITK) + +Copyright (c) German Cancer Research Center, +Division of Medical and Biological Informatics. +All rights reserved. + +This software is distributed WITHOUT ANY WARRANTY; without +even the implied warranty of MERCHANTABILITY or FITNESS FOR +A PARTICULAR PURPOSE. + +See LICENSE.txt or http://www.mitk.org for details. + +===================================================================*/ + +#include "QmitkFiberProcessingPerspective.h" +#include "berryIViewLayout.h" + +QmitkFiberProcessingPerspective::QmitkFiberProcessingPerspective() +{ +} + +QmitkFiberProcessingPerspective::QmitkFiberProcessingPerspective(const QmitkFiberProcessingPerspective& other) +{ + Q_UNUSED(other) + throw std::runtime_error("Copy constructor not implemented"); +} + +void QmitkFiberProcessingPerspective::CreateInitialLayout(berry::IPageLayout::Pointer layout) +{ + ///////////////////////////////////////////////////// + // all di-app perspectives should have the following: + ///////////////////////////////////////////////////// + + std::string editorArea = layout->GetEditorArea(); + + layout->AddStandaloneView("org.mitk.views.datamanager", + false, berry::IPageLayout::LEFT, 0.3f, editorArea); + + layout->AddStandaloneView("org.mitk.views.controlvisualizationpropertiesview", + false, berry::IPageLayout::BOTTOM, .15f, "org.mitk.views.datamanager"); + + berry::IFolderLayout::Pointer left = + layout->CreateFolder("org.mbi.diffusionimaginginternal.leftcontrols", + berry::IPageLayout::BOTTOM, 0.1f, "org.mitk.views.controlvisualizationpropertiesview"); + + layout->AddStandaloneViewPlaceholder("org.mitk.views.imagenavigator", + berry::IPageLayout::BOTTOM, .7f, "org.mbi.diffusionimaginginternal.leftcontrols", false); + + ///////////////////////////////////////////// + // here goes the perspective specific stuff + ///////////////////////////////////////////// + + left->AddView("org.mitk.views.fiberextraction"); + left->AddView("org.mitk.views.fiberprocessing"); +} diff --git a/Plugins/org.mitk.gui.qt.diffusionimagingapp/src/internal/Perspectives/QmitkDIAppImageProcessingPerspective.h b/Plugins/org.mitk.gui.qt.diffusionimaging/src/internal/Perspectives/QmitkFiberProcessingPerspective.h similarity index 66% rename from Plugins/org.mitk.gui.qt.diffusionimagingapp/src/internal/Perspectives/QmitkDIAppImageProcessingPerspective.h rename to Plugins/org.mitk.gui.qt.diffusionimaging/src/internal/Perspectives/QmitkFiberProcessingPerspective.h index dd2b769a64..c079a709f9 100644 --- a/Plugins/org.mitk.gui.qt.diffusionimagingapp/src/internal/Perspectives/QmitkDIAppImageProcessingPerspective.h +++ b/Plugins/org.mitk.gui.qt.diffusionimaging/src/internal/Perspectives/QmitkFiberProcessingPerspective.h @@ -1,36 +1,36 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ -#ifndef QmitkDIAppImageProcessingPerspective_H_ -#define QmitkDIAppImageProcessingPerspective_H_ +#ifndef QmitkFiberProcessingPerspective_H_ +#define QmitkFiberProcessingPerspective_H_ #include -class QmitkDIAppImageProcessingPerspective : public QObject, public berry::IPerspectiveFactory +class QmitkFiberProcessingPerspective : public QObject, public berry::IPerspectiveFactory { Q_OBJECT Q_INTERFACES(berry::IPerspectiveFactory) public: - QmitkDIAppImageProcessingPerspective() {} - ~QmitkDIAppImageProcessingPerspective() {} + QmitkFiberProcessingPerspective(); + QmitkFiberProcessingPerspective(const QmitkFiberProcessingPerspective& other); void CreateInitialLayout(berry::IPageLayout::Pointer layout); }; -#endif /* QmitkDIAppImageProcessingPerspective_H_ */ +#endif /* QmitkFiberProcessingPerspective_H_ */ diff --git a/Plugins/org.mitk.gui.qt.diffusionimaging/src/internal/Perspectives/QmitkGibbsTractographyPerspective.cpp b/Plugins/org.mitk.gui.qt.diffusionimaging/src/internal/Perspectives/QmitkGibbsTractographyPerspective.cpp new file mode 100644 index 0000000000..93d631206f --- /dev/null +++ b/Plugins/org.mitk.gui.qt.diffusionimaging/src/internal/Perspectives/QmitkGibbsTractographyPerspective.cpp @@ -0,0 +1,48 @@ +/*=================================================================== + +The Medical Imaging Interaction Toolkit (MITK) + +Copyright (c) German Cancer Research Center, +Division of Medical and Biological Informatics. +All rights reserved. + +This software is distributed WITHOUT ANY WARRANTY; without +even the implied warranty of MERCHANTABILITY or FITNESS FOR +A PARTICULAR PURPOSE. + +See LICENSE.txt or http://www.mitk.org for details. + +===================================================================*/ + +#include "QmitkGibbsTractographyPerspective.h" +#include "berryIViewLayout.h" + +void QmitkGibbsTractographyPerspective::CreateInitialLayout(berry::IPageLayout::Pointer layout) +{ + ///////////////////////////////////////////////////// + // all di-app perspectives should have the following: + ///////////////////////////////////////////////////// + + std::string editorArea = layout->GetEditorArea(); + + layout->AddStandaloneView("org.mitk.views.datamanager", + false, berry::IPageLayout::LEFT, 0.3f, editorArea); + + layout->AddStandaloneView("org.mitk.views.controlvisualizationpropertiesview", + false, berry::IPageLayout::BOTTOM, .15f, "org.mitk.views.datamanager"); + + berry::IFolderLayout::Pointer left = + layout->CreateFolder("org.mbi.diffusionimaginginternal.leftcontrols", + berry::IPageLayout::BOTTOM, 0.1f, "org.mitk.views.controlvisualizationpropertiesview"); + + layout->AddStandaloneViewPlaceholder("org.mitk.views.imagenavigator", + berry::IPageLayout::BOTTOM, .7f, "org.mbi.diffusionimaginginternal.leftcontrols", false); + + ///////////////////////////////////////////// + // here goes the perspective specific stuff + ///////////////////////////////////////////// + + left->AddView("org.mitk.views.tensorreconstruction"); + left->AddView("org.mitk.views.qballreconstruction"); + left->AddView("org.mitk.views.gibbstracking"); +} diff --git a/Plugins/org.mitk.gui.qt.diffusionimagingapp/src/internal/Perspectives/QmitkGibbsTractographyPerspective.h b/Plugins/org.mitk.gui.qt.diffusionimaging/src/internal/Perspectives/QmitkGibbsTractographyPerspective.h similarity index 100% rename from Plugins/org.mitk.gui.qt.diffusionimagingapp/src/internal/Perspectives/QmitkGibbsTractographyPerspective.h rename to Plugins/org.mitk.gui.qt.diffusionimaging/src/internal/Perspectives/QmitkGibbsTractographyPerspective.h diff --git a/Plugins/org.mitk.gui.qt.diffusionimaging/src/internal/Perspectives/QmitkProbabilisticTractographyPerspective.cpp b/Plugins/org.mitk.gui.qt.diffusionimaging/src/internal/Perspectives/QmitkProbabilisticTractographyPerspective.cpp new file mode 100644 index 0000000000..cf79a7b90d --- /dev/null +++ b/Plugins/org.mitk.gui.qt.diffusionimaging/src/internal/Perspectives/QmitkProbabilisticTractographyPerspective.cpp @@ -0,0 +1,48 @@ +/*=================================================================== + +The Medical Imaging Interaction Toolkit (MITK) + +Copyright (c) German Cancer Research Center, +Division of Medical and Biological Informatics. +All rights reserved. + +This software is distributed WITHOUT ANY WARRANTY; without +even the implied warranty of MERCHANTABILITY or FITNESS FOR +A PARTICULAR PURPOSE. + +See LICENSE.txt or http://www.mitk.org for details. + +===================================================================*/ + +#include "QmitkProbabilisticTractographyPerspective.h" +#include "berryIViewLayout.h" + +void QmitkProbabilisticTractographyPerspective::CreateInitialLayout(berry::IPageLayout::Pointer layout) +{ + ///////////////////////////////////////////////////// + // all di-app perspectives should have the following: + ///////////////////////////////////////////////////// + + std::string editorArea = layout->GetEditorArea(); + + layout->AddStandaloneView("org.mitk.views.datamanager", + false, berry::IPageLayout::LEFT, 0.3f, editorArea); + + layout->AddStandaloneView("org.mitk.views.controlvisualizationpropertiesview", + false, berry::IPageLayout::BOTTOM, .15f, "org.mitk.views.datamanager"); + + berry::IFolderLayout::Pointer left = + layout->CreateFolder("org.mbi.diffusionimaginginternal.leftcontrols", + berry::IPageLayout::BOTTOM, 0.1f, "org.mitk.views.controlvisualizationpropertiesview"); + + layout->AddStandaloneViewPlaceholder("org.mitk.views.imagenavigator", + berry::IPageLayout::BOTTOM, .7f, "org.mbi.diffusionimaginginternal.leftcontrols", false); + + ///////////////////////////////////////////// + // here goes the perspective specific stuff + ///////////////////////////////////////////// + + left->AddView("org.mitk.views.diffusionpreprocessing"); + left->AddView("org.mitk.views.segmentation"); + left->AddView("org.mitk.views.stochasticfibertracking"); +} diff --git a/Plugins/org.mitk.gui.qt.diffusionimagingapp/src/internal/Perspectives/QmitkProbabilisticTractographyPerspective.h b/Plugins/org.mitk.gui.qt.diffusionimaging/src/internal/Perspectives/QmitkProbabilisticTractographyPerspective.h similarity index 100% rename from Plugins/org.mitk.gui.qt.diffusionimagingapp/src/internal/Perspectives/QmitkProbabilisticTractographyPerspective.h rename to Plugins/org.mitk.gui.qt.diffusionimaging/src/internal/Perspectives/QmitkProbabilisticTractographyPerspective.h diff --git a/Plugins/org.mitk.gui.qt.diffusionimaging/src/internal/Perspectives/QmitkStreamlineTractographyPerspective.cpp b/Plugins/org.mitk.gui.qt.diffusionimaging/src/internal/Perspectives/QmitkStreamlineTractographyPerspective.cpp new file mode 100644 index 0000000000..6bde7b3ef0 --- /dev/null +++ b/Plugins/org.mitk.gui.qt.diffusionimaging/src/internal/Perspectives/QmitkStreamlineTractographyPerspective.cpp @@ -0,0 +1,48 @@ +/*=================================================================== + +The Medical Imaging Interaction Toolkit (MITK) + +Copyright (c) German Cancer Research Center, +Division of Medical and Biological Informatics. +All rights reserved. + +This software is distributed WITHOUT ANY WARRANTY; without +even the implied warranty of MERCHANTABILITY or FITNESS FOR +A PARTICULAR PURPOSE. + +See LICENSE.txt or http://www.mitk.org for details. + +===================================================================*/ + +#include "QmitkStreamlineTractographyPerspective.h" +#include "berryIViewLayout.h" + +void QmitkStreamlineTractographyPerspective::CreateInitialLayout(berry::IPageLayout::Pointer layout) +{ + ///////////////////////////////////////////////////// + // all di-app perspectives should have the following: + ///////////////////////////////////////////////////// + + std::string editorArea = layout->GetEditorArea(); + + layout->AddStandaloneView("org.mitk.views.datamanager", + false, berry::IPageLayout::LEFT, 0.3f, editorArea); + + layout->AddStandaloneView("org.mitk.views.controlvisualizationpropertiesview", + false, berry::IPageLayout::BOTTOM, .15f, "org.mitk.views.datamanager"); + + berry::IFolderLayout::Pointer left = + layout->CreateFolder("org.mbi.diffusionimaginginternal.leftcontrols", + berry::IPageLayout::BOTTOM, 0.1f, "org.mitk.views.controlvisualizationpropertiesview"); + + layout->AddStandaloneViewPlaceholder("org.mitk.views.imagenavigator", + berry::IPageLayout::BOTTOM, .7f, "org.mbi.diffusionimaginginternal.leftcontrols", false); + + ///////////////////////////////////////////// + // here goes the perspective specific stuff + ///////////////////////////////////////////// + + left->AddView("org.mitk.views.tensorreconstruction"); + left->AddView("org.mitk.views.segmentation"); + left->AddView("org.mitk.views.streamlinetracking"); +} diff --git a/Plugins/org.mitk.gui.qt.diffusionimagingapp/src/internal/Perspectives/QmitkStreamlineTractographyPerspective.h b/Plugins/org.mitk.gui.qt.diffusionimaging/src/internal/Perspectives/QmitkStreamlineTractographyPerspective.h similarity index 100% rename from Plugins/org.mitk.gui.qt.diffusionimagingapp/src/internal/Perspectives/QmitkStreamlineTractographyPerspective.h rename to Plugins/org.mitk.gui.qt.diffusionimaging/src/internal/Perspectives/QmitkStreamlineTractographyPerspective.h diff --git a/Plugins/org.mitk.gui.qt.diffusionimaging/src/internal/QmitkDiffusionImagingPublicPerspective.cpp b/Plugins/org.mitk.gui.qt.diffusionimaging/src/internal/QmitkDiffusionImagingPublicPerspective.cpp deleted file mode 100644 index 9ab9b5f24a..0000000000 --- a/Plugins/org.mitk.gui.qt.diffusionimaging/src/internal/QmitkDiffusionImagingPublicPerspective.cpp +++ /dev/null @@ -1,76 +0,0 @@ -/*=================================================================== - -The Medical Imaging Interaction Toolkit (MITK) - -Copyright (c) German Cancer Research Center, -Division of Medical and Biological Informatics. -All rights reserved. - -This software is distributed WITHOUT ANY WARRANTY; without -even the implied warranty of MERCHANTABILITY or FITNESS FOR -A PARTICULAR PURPOSE. - -See LICENSE.txt or http://www.mitk.org for details. - -===================================================================*/ - -#include "QmitkDiffusionImagingPublicPerspective.h" -#include "berryIViewLayout.h" - -QmitkDiffusionImagingPublicPerspective::QmitkDiffusionImagingPublicPerspective() -{ -} - -QmitkDiffusionImagingPublicPerspective::QmitkDiffusionImagingPublicPerspective(const QmitkDiffusionImagingPublicPerspective& other) -{ - Q_UNUSED(other) - throw std::runtime_error("Copy constructor not implemented"); -} - -void QmitkDiffusionImagingPublicPerspective::CreateInitialLayout(berry::IPageLayout::Pointer layout) -{ - std::string editorArea = layout->GetEditorArea(); - - layout->AddStandaloneView("org.mitk.views.datamanager", - false, berry::IPageLayout::LEFT, 0.3f, editorArea); - - layout->AddStandaloneView("org.mitk.views.controlvisualizationpropertiesview", - false, berry::IPageLayout::BOTTOM, .2f, "org.mitk.views.datamanager"); - - berry::IFolderLayout::Pointer left = - layout->CreateFolder("org.mitk.leftcontrols", - berry::IPageLayout::BOTTOM, 0.125f, "org.mitk.views.controlvisualizationpropertiesview"); - - layout->AddStandaloneView("org.mitk.views.imagenavigator", - false, berry::IPageLayout::BOTTOM, 0.8f, "org.mitk.leftcontrols"); - - layout->AddStandaloneView("org.mitk.views.perspectiveswitcher", - false, berry::IPageLayout::BOTTOM, 0.99f, "org.mitk.views.imagenavigator"); - -// layout->AddStandaloneViewPlaceholder("org.mitk.views.imagenavigator", -// berry::IPageLayout::TOP, 0.9f, "org.mitk.views.perspectiveswitcher",false); - - left->AddView("org.mitk.views.diffusionpreprocessing"); - left->AddView("org.mitk.views.tensorreconstruction"); - left->AddView("org.mitk.views.qballreconstruction"); - left->AddView("org.mitk.views.diffusionquantification"); - left->AddView("org.mitk.views.diffusiondicomimport"); - - berry::IViewLayout::Pointer lo = layout->GetViewLayout("org.mitk.views.diffusionpreprocessing"); - lo->SetCloseable(false); - - lo = layout->GetViewLayout("org.mitk.views.qballreconstruction"); - lo->SetCloseable(false); - - lo = layout->GetViewLayout("org.mitk.views.tensorreconstruction"); - lo->SetCloseable(false); - - lo = layout->GetViewLayout("org.mitk.views.diffusionquantification"); - lo->SetCloseable(false); - - lo = layout->GetViewLayout("org.mitk.views.diffusiondicomimport"); - lo->SetCloseable(false); - - //berry::IFolderLayout::Pointer right2 = - // layout->CreateFolder("right2", berry::IPageLayout::BOTTOM, 0.5f, "right"); -} \ No newline at end of file diff --git a/Plugins/org.mitk.gui.qt.diffusionimaging/src/internal/QmitkDiffusionImagingPublicPerspective.h b/Plugins/org.mitk.gui.qt.diffusionimaging/src/internal/QmitkDiffusionImagingPublicPerspective.h deleted file mode 100644 index 46c774ca0e..0000000000 --- a/Plugins/org.mitk.gui.qt.diffusionimaging/src/internal/QmitkDiffusionImagingPublicPerspective.h +++ /dev/null @@ -1,36 +0,0 @@ -/*=================================================================== - -The Medical Imaging Interaction Toolkit (MITK) - -Copyright (c) German Cancer Research Center, -Division of Medical and Biological Informatics. -All rights reserved. - -This software is distributed WITHOUT ANY WARRANTY; without -even the implied warranty of MERCHANTABILITY or FITNESS FOR -A PARTICULAR PURPOSE. - -See LICENSE.txt or http://www.mitk.org for details. - -===================================================================*/ - - -#ifndef QMITKDIFFUSIONIMAGINGPUBLICPERSPECTIVE_H_ -#define QMITKDIFFUSIONIMAGINGPUBLICPERSPECTIVE_H_ - -#include - -class QmitkDiffusionImagingPublicPerspective : public QObject, public berry::IPerspectiveFactory -{ - Q_OBJECT - Q_INTERFACES(berry::IPerspectiveFactory) - -public: - - QmitkDiffusionImagingPublicPerspective(); - QmitkDiffusionImagingPublicPerspective(const QmitkDiffusionImagingPublicPerspective& other); - - void CreateInitialLayout(berry::IPageLayout::Pointer layout); -}; - -#endif /* QMITKDIFFUSIONIMAGINGPUBLICPERSPECTIVE_H_ */ diff --git a/Plugins/org.mitk.gui.qt.diffusionimaging/src/internal/mitkPluginActivator.cpp b/Plugins/org.mitk.gui.qt.diffusionimaging/src/internal/mitkPluginActivator.cpp index c2db49d785..93e0e7930c 100644 --- a/Plugins/org.mitk.gui.qt.diffusionimaging/src/internal/mitkPluginActivator.cpp +++ b/Plugins/org.mitk.gui.qt.diffusionimaging/src/internal/mitkPluginActivator.cpp @@ -1,89 +1,100 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #include "mitkPluginActivator.h" #include -#include "src/internal/QmitkDiffusionImagingPublicPerspective.h" +#include "src/internal/Perspectives/QmitkDiffusionImagingAppPerspective.h" + +#include "src/internal/Perspectives/QmitkDIAppIVIMPerspective.h" +#include "src/internal/Perspectives/QmitkDIAppSyntheticDataGenerationPerspective.h" +#include "src/internal/Perspectives/QmitkGibbsTractographyPerspective.h" +#include "src/internal/Perspectives/QmitkStreamlineTractographyPerspective.h" +#include "src/internal/Perspectives/QmitkProbabilisticTractographyPerspective.h" +#include "src/internal/Perspectives/QmitkFiberProcessingPerspective.h" #include "src/internal/QmitkQBallReconstructionView.h" #include "src/internal/QmitkPreprocessingView.h" #include "src/internal/QmitkDiffusionDicomImportView.h" #include "src/internal/QmitkDiffusionQuantificationView.h" #include "src/internal/QmitkTensorReconstructionView.h" #include "src/internal/QmitkControlVisualizationPropertiesView.h" #include "src/internal/QmitkODFDetailsView.h" #include "src/internal/QmitkGibbsTrackingView.h" #include "src/internal/QmitkStochasticFiberTrackingView.h" #include "src/internal/QmitkFiberProcessingView.h" -//#include "src/internal/QmitkFiberBundleDeveloperView.h" #include "src/internal/QmitkPartialVolumeAnalysisView.h" #include "src/internal/QmitkIVIMView.h" #include "src/internal/QmitkTractbasedSpatialStatisticsView.h" #include "src/internal/QmitkTbssSkeletonizationView.h" #include "src/internal/QmitkStreamlineTrackingView.h" #include "src/internal/Connectomics/QmitkConnectomicsDataView.h" #include "src/internal/Connectomics/QmitkConnectomicsNetworkOperationsView.h" #include "src/internal/Connectomics/QmitkConnectomicsStatisticsView.h" #include "src/internal/QmitkOdfMaximaExtractionView.h" #include "src/internal/QmitkFiberfoxView.h" #include "src/internal/QmitkFiberExtractionView.h" #include "src/internal/QmitkFieldmapGeneratorView.h" #include "src/internal/QmitkDiffusionRegistrationView.h" #include "src/internal/QmitkDenoisingView.h" namespace mitk { void PluginActivator::start(ctkPluginContext* context) { - BERRY_REGISTER_EXTENSION_CLASS(QmitkDiffusionImagingPublicPerspective, context) + BERRY_REGISTER_EXTENSION_CLASS(QmitkDiffusionImagingAppPerspective, context) + BERRY_REGISTER_EXTENSION_CLASS(QmitkGibbsTractographyPerspective, context) + BERRY_REGISTER_EXTENSION_CLASS(QmitkStreamlineTractographyPerspective, context) + BERRY_REGISTER_EXTENSION_CLASS(QmitkProbabilisticTractographyPerspective, context) + BERRY_REGISTER_EXTENSION_CLASS(QmitkDIAppSyntheticDataGenerationPerspective, context) + BERRY_REGISTER_EXTENSION_CLASS(QmitkDIAppIVIMPerspective, context) + BERRY_REGISTER_EXTENSION_CLASS(QmitkFiberProcessingPerspective, context) BERRY_REGISTER_EXTENSION_CLASS(QmitkQBallReconstructionView, context) BERRY_REGISTER_EXTENSION_CLASS(QmitkPreprocessingView, context) BERRY_REGISTER_EXTENSION_CLASS(QmitkDiffusionDicomImport, context) BERRY_REGISTER_EXTENSION_CLASS(QmitkDiffusionQuantificationView, context) BERRY_REGISTER_EXTENSION_CLASS(QmitkTensorReconstructionView, context) BERRY_REGISTER_EXTENSION_CLASS(QmitkControlVisualizationPropertiesView, context) BERRY_REGISTER_EXTENSION_CLASS(QmitkODFDetailsView, context) BERRY_REGISTER_EXTENSION_CLASS(QmitkGibbsTrackingView, context) BERRY_REGISTER_EXTENSION_CLASS(QmitkStochasticFiberTrackingView, context) BERRY_REGISTER_EXTENSION_CLASS(QmitkFiberProcessingView, context) -// BERRY_REGISTER_EXTENSION_CLASS(QmitkFiberBundleDeveloperView, context) BERRY_REGISTER_EXTENSION_CLASS(QmitkPartialVolumeAnalysisView, context) BERRY_REGISTER_EXTENSION_CLASS(QmitkIVIMView, context) BERRY_REGISTER_EXTENSION_CLASS(QmitkTractbasedSpatialStatisticsView, context) BERRY_REGISTER_EXTENSION_CLASS(QmitkTbssSkeletonizationView, context) BERRY_REGISTER_EXTENSION_CLASS(QmitkConnectomicsDataView, context) BERRY_REGISTER_EXTENSION_CLASS(QmitkConnectomicsNetworkOperationsView, context) BERRY_REGISTER_EXTENSION_CLASS(QmitkConnectomicsStatisticsView, context) BERRY_REGISTER_EXTENSION_CLASS(QmitkStreamlineTrackingView, context) BERRY_REGISTER_EXTENSION_CLASS(QmitkOdfMaximaExtractionView, context) BERRY_REGISTER_EXTENSION_CLASS(QmitkFiberfoxView, context) BERRY_REGISTER_EXTENSION_CLASS(QmitkFiberExtractionView, context) BERRY_REGISTER_EXTENSION_CLASS(QmitkFieldmapGeneratorView, context) BERRY_REGISTER_EXTENSION_CLASS(QmitkDiffusionRegistrationView, context) BERRY_REGISTER_EXTENSION_CLASS(QmitkDenoisingView, context) } void PluginActivator::stop(ctkPluginContext* context) { Q_UNUSED(context) } } Q_EXPORT_PLUGIN2(org_mitk_gui_qt_diffusionimaging, mitk::PluginActivator) diff --git a/Plugins/org.mitk.gui.qt.diffusionimagingapp/files.cmake b/Plugins/org.mitk.gui.qt.diffusionimagingapp/files.cmake index 290dbb4f1f..f1f9f6b993 100644 --- a/Plugins/org.mitk.gui.qt.diffusionimagingapp/files.cmake +++ b/Plugins/org.mitk.gui.qt.diffusionimagingapp/files.cmake @@ -1,103 +1,66 @@ set(SRC_CPP_FILES QmitkDiffusionImagingAppApplication.cpp QmitkDiffusionImagingAppWorkbenchAdvisor.cpp ) set(INTERNAL_CPP_FILES QmitkDiffusionApplicationPlugin.cpp QmitkDiffusionImagingAppIntroPart.cpp - Perspectives/QmitkDiffusionImagingAppPerspective.cpp Perspectives/QmitkWelcomePerspective.cpp - Perspectives/QmitkDIAppConnectomicsPerspective.cpp - Perspectives/QmitkDIAppDicomImportPerspective.cpp - Perspectives/QmitkDIAppIVIMPerspective.cpp - Perspectives/QmitkDIAppPreprocessingReconstructionPerspective.cpp - Perspectives/QmitkDIAppQuantificationPerspective.cpp - Perspectives/QmitkDIAppTBSSPerspective.cpp - Perspectives/QmitkDIAppUtilityPerspective.cpp - Perspectives/QmitkDIAppImageProcessingPerspective.cpp - Perspectives/QmitkDIAppSyntheticDataGenerationPerspective.cpp - Perspectives/QmitkDIAppRegistrationPerspective.cpp - Perspectives/QmitkDIAppVisualizationPerspective.cpp - -# new perspectives - Perspectives/QmitkGibbsTractographyPerspective.cpp - Perspectives/QmitkStreamlineTractographyPerspective.cpp - Perspectives/QmitkProbabilisticTractographyPerspective.cpp ) set(UI_FILES src/internal/QmitkWelcomeScreenViewControls.ui ) set(MOC_H_FILES src/internal/QmitkDiffusionImagingAppIntroPart.h src/internal/QmitkDiffusionApplicationPlugin.h src/QmitkDiffusionImagingAppApplication.h - src/internal/Perspectives/QmitkDiffusionImagingAppPerspective.h src/internal/Perspectives/QmitkWelcomePerspective.h - src/internal/Perspectives/QmitkDIAppConnectomicsPerspective.h - src/internal/Perspectives/QmitkDIAppDicomImportPerspective.h - src/internal/Perspectives/QmitkDIAppIVIMPerspective.h - src/internal/Perspectives/QmitkDIAppPreprocessingReconstructionPerspective.h - src/internal/Perspectives/QmitkDIAppQuantificationPerspective.h - src/internal/Perspectives/QmitkDIAppTBSSPerspective.h - src/internal/Perspectives/QmitkDIAppUtilityPerspective.h - src/internal/Perspectives/QmitkDIAppImageProcessingPerspective.h - src/internal/Perspectives/QmitkDIAppSyntheticDataGenerationPerspective.h - src/internal/Perspectives/QmitkDIAppRegistrationPerspective.h - src/internal/Perspectives/QmitkDIAppVisualizationPerspective.h - -# new perspectives - src/internal/Perspectives/QmitkGibbsTractographyPerspective.h - src/internal/Perspectives/QmitkStreamlineTractographyPerspective.h - src/internal/Perspectives/QmitkProbabilisticTractographyPerspective.h ) set(CACHED_RESOURCE_FILES # list of resource files which can be used by the plug-in # system without loading the plug-ins shared library, # for example the icon used in the menu and tabs for the # plug-in views in the workbench plugin.xml resources/icon_dicom.xpm resources/diffusionimaging.png resources/preprocessing.png resources/Measurement_48.png resources/volvis.png resources/perspectives/diffusionimaging.png resources/perspectives/icon_home.png resources/perspectives/connectomics.png resources/perspectives/dicomimport.png - resources/perspectives/tractography.png - resources/perspectives/ivim.png resources/perspectives/preprocessingreconstruction.png resources/perspectives/quantification.png resources/perspectives/tbss.png resources/perspectives/utilities.png resources/perspectives/imageProcessing.png resources/perspectives/registration.png resources/perspectives/phantomData2.png resources/perspectives/eye.png resources/perspectives/registration.xpm resources/perspectives/chart.png resources/perspectives/preprocessing.png - resources/perspectives/syntheticdata.png ) set(QRC_FILES # uncomment the following line if you want to use Qt resources resources/welcome/QmitkWelcomeScreenView.qrc resources/org_mitk_gui_qt_diffusionimagingapp.qrc ) # set(CPP_FILES) foreach(file ${SRC_CPP_FILES}) set(CPP_FILES ${CPP_FILES} src/${file}) endforeach(file ${SRC_CPP_FILES}) foreach(file ${INTERNAL_CPP_FILES}) set(CPP_FILES ${CPP_FILES} src/internal/${file}) endforeach(file ${INTERNAL_CPP_FILES}) diff --git a/Plugins/org.mitk.gui.qt.diffusionimagingapp/plugin.xml b/Plugins/org.mitk.gui.qt.diffusionimagingapp/plugin.xml index 4c3a284b86..c727fdd185 100644 --- a/Plugins/org.mitk.gui.qt.diffusionimagingapp/plugin.xml +++ b/Plugins/org.mitk.gui.qt.diffusionimagingapp/plugin.xml @@ -1,109 +1,27 @@ - - - - - - - - Preprocessing of raw diffusion data and diffusion propagator modeling - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Plugins/org.mitk.gui.qt.diffusionimagingapp/src/QmitkDiffusionImagingAppWorkbenchAdvisor.cpp b/Plugins/org.mitk.gui.qt.diffusionimagingapp/src/QmitkDiffusionImagingAppWorkbenchAdvisor.cpp index 7046505d06..2cab188697 100644 --- a/Plugins/org.mitk.gui.qt.diffusionimagingapp/src/QmitkDiffusionImagingAppWorkbenchAdvisor.cpp +++ b/Plugins/org.mitk.gui.qt.diffusionimagingapp/src/QmitkDiffusionImagingAppWorkbenchAdvisor.cpp @@ -1,86 +1,85 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #include "QmitkDiffusionImagingAppWorkbenchAdvisor.h" #include "internal/QmitkDiffusionApplicationPlugin.h" #include #include #include #include #include #include const std::string QmitkDiffusionImagingAppWorkbenchAdvisor::WELCOME_PERSPECTIVE_ID = "org.mitk.diffusionimagingapp.perspectives.welcome"; void QmitkDiffusionImagingAppWorkbenchAdvisor::Initialize(berry::IWorkbenchConfigurer::Pointer configurer) { berry::QtWorkbenchAdvisor::Initialize(configurer); configurer->SetSaveAndRestore(true); } berry::WorkbenchWindowAdvisor* QmitkDiffusionImagingAppWorkbenchAdvisor::CreateWorkbenchWindowAdvisor( berry::IWorkbenchWindowConfigurer::Pointer configurer) { std::vector perspExcludeList; perspExcludeList.push_back( std::string("org.blueberry.uitest.util.EmptyPerspective") ); perspExcludeList.push_back( std::string("org.blueberry.uitest.util.EmptyPerspective2") ); // perspExcludeList.push_back( std::string("org.mitk.coreapp.defaultperspective") ); //perspExcludeList.push_back( std::string("org.mitk.extapp.defaultperspective") ); perspExcludeList.push_back( std::string("org.mitk.perspectives.publicdiffusionimaging") ); perspExcludeList.push_back( std::string("org.mitk.perspectives.diffusionimaginginternal") ); // Exclude the help perspective from org.blueberry.ui.qt.help from // the normal perspective list. // The perspective gets a dedicated menu entry in the help menu perspExcludeList.push_back("org.blueberry.perspectives.help"); std::vector viewExcludeList; viewExcludeList.push_back( std::string("org.mitk.views.controlvisualizationpropertiesview") ); viewExcludeList.push_back( std::string("org.mitk.views.imagenavigator") ); // viewExcludeList.push_back( std::string("org.mitk.views.datamanager") ); viewExcludeList.push_back( std::string("org.mitk.views.modules") ); viewExcludeList.push_back( std::string("org.blueberry.ui.internal.introview") ); configurer->SetInitialSize(berry::Point(1000,770)); QmitkExtWorkbenchWindowAdvisor* advisor = new QmitkExtWorkbenchWindowAdvisor(this, configurer); advisor->ShowViewMenuItem(true); advisor->ShowNewWindowMenuItem(true); advisor->ShowClosePerspectiveMenuItem(true); advisor->SetPerspectiveExcludeList(perspExcludeList); advisor->SetViewExcludeList(viewExcludeList); advisor->ShowViewToolbar(false); advisor->ShowPerspectiveToolbar(false); advisor->ShowVersionInfo(false); - advisor->EnableCandyStore(true); advisor->ShowMitkVersionInfo(false); advisor->ShowMemoryIndicator(false); advisor->SetProductName("MITK Diffusion"); advisor->SetWindowIcon(":/org.mitk.gui.qt.diffusionimagingapp/app-icon.png"); return advisor; } std::string QmitkDiffusionImagingAppWorkbenchAdvisor::GetInitialWindowPerspectiveId() { return WELCOME_PERSPECTIVE_ID; } diff --git a/Plugins/org.mitk.gui.qt.diffusionimagingapp/src/internal/Perspectives/QmitkDIAppConnectomicsPerspective.cpp b/Plugins/org.mitk.gui.qt.diffusionimagingapp/src/internal/Perspectives/QmitkDIAppConnectomicsPerspective.cpp deleted file mode 100644 index 5d453d89be..0000000000 --- a/Plugins/org.mitk.gui.qt.diffusionimagingapp/src/internal/Perspectives/QmitkDIAppConnectomicsPerspective.cpp +++ /dev/null @@ -1,57 +0,0 @@ -/*=================================================================== - -The Medical Imaging Interaction Toolkit (MITK) - -Copyright (c) German Cancer Research Center, -Division of Medical and Biological Informatics. -All rights reserved. - -This software is distributed WITHOUT ANY WARRANTY; without -even the implied warranty of MERCHANTABILITY or FITNESS FOR -A PARTICULAR PURPOSE. - -See LICENSE.txt or http://www.mitk.org for details. - -===================================================================*/ - -#include "QmitkDIAppConnectomicsPerspective.h" -#include "berryIViewLayout.h" - -void QmitkDIAppConnectomicsPerspective::CreateInitialLayout(berry::IPageLayout::Pointer layout) -{ - - ///////////////////////////////////////////////////// - // all di-app perspectives should have the following: - ///////////////////////////////////////////////////// - - std::string editorArea = layout->GetEditorArea(); - - layout->AddStandaloneView("org.mitk.views.datamanager", - false, berry::IPageLayout::LEFT, 0.3f, editorArea); - - layout->AddStandaloneView("org.mitk.views.controlvisualizationpropertiesview", - false, berry::IPageLayout::BOTTOM, .15f, "org.mitk.views.datamanager"); - - berry::IFolderLayout::Pointer left = - layout->CreateFolder("org.mbi.diffusionimaginginternal.leftcontrols", - berry::IPageLayout::BOTTOM, 0.1f, "org.mitk.views.controlvisualizationpropertiesview"); - - layout->AddStandaloneViewPlaceholder("org.mitk.views.imagenavigator", - berry::IPageLayout::BOTTOM, .4f, "org.mbi.diffusionimaginginternal.leftcontrols", false); - - ///////////////////////////////////////////// - // here goes the perspective specific stuff - ///////////////////////////////////////////// - - left->AddView("org.mitk.views.connectomicsstatistics"); - berry::IViewLayout::Pointer lo = layout->GetViewLayout("org.mitk.views.connectomicsstatistics"); - - - left->AddView("org.mitk.views.connectomicsnetworkoperations"); - lo = layout->GetViewLayout("org.mitk.views.connectomicsnetworkoperations"); - - - left->AddView("org.mitk.views.connectomicsdata"); - lo = layout->GetViewLayout("org.mitk.views.connectomicsdata"); - -} diff --git a/Plugins/org.mitk.gui.qt.diffusionimagingapp/src/internal/Perspectives/QmitkDIAppConnectomicsPerspective.h b/Plugins/org.mitk.gui.qt.diffusionimagingapp/src/internal/Perspectives/QmitkDIAppConnectomicsPerspective.h deleted file mode 100644 index 95c1615e54..0000000000 --- a/Plugins/org.mitk.gui.qt.diffusionimagingapp/src/internal/Perspectives/QmitkDIAppConnectomicsPerspective.h +++ /dev/null @@ -1,36 +0,0 @@ -/*=================================================================== - -The Medical Imaging Interaction Toolkit (MITK) - -Copyright (c) German Cancer Research Center, -Division of Medical and Biological Informatics. -All rights reserved. - -This software is distributed WITHOUT ANY WARRANTY; without -even the implied warranty of MERCHANTABILITY or FITNESS FOR -A PARTICULAR PURPOSE. - -See LICENSE.txt or http://www.mitk.org for details. - -===================================================================*/ - - -#ifndef QmitkDIAppConnectomicsPerspective_H_ -#define QmitkDIAppConnectomicsPerspective_H_ - -#include - -class QmitkDIAppConnectomicsPerspective : public QObject, public berry::IPerspectiveFactory -{ - Q_OBJECT - Q_INTERFACES(berry::IPerspectiveFactory) - -public: - - QmitkDIAppConnectomicsPerspective() {} - ~QmitkDIAppConnectomicsPerspective() {} - - void CreateInitialLayout(berry::IPageLayout::Pointer layout); -}; - -#endif /* QmitkDIAppConnectomicsPerspective_H_ */ diff --git a/Plugins/org.mitk.gui.qt.diffusionimagingapp/src/internal/Perspectives/QmitkDIAppDicomImportPerspective.cpp b/Plugins/org.mitk.gui.qt.diffusionimagingapp/src/internal/Perspectives/QmitkDIAppDicomImportPerspective.cpp deleted file mode 100644 index 6e23a31e1f..0000000000 --- a/Plugins/org.mitk.gui.qt.diffusionimagingapp/src/internal/Perspectives/QmitkDIAppDicomImportPerspective.cpp +++ /dev/null @@ -1,49 +0,0 @@ -/*=================================================================== - -The Medical Imaging Interaction Toolkit (MITK) - -Copyright (c) German Cancer Research Center, -Division of Medical and Biological Informatics. -All rights reserved. - -This software is distributed WITHOUT ANY WARRANTY; without -even the implied warranty of MERCHANTABILITY or FITNESS FOR -A PARTICULAR PURPOSE. - -See LICENSE.txt or http://www.mitk.org for details. - -===================================================================*/ - -#include "QmitkDIAppDicomImportPerspective.h" -#include "berryIViewLayout.h" - -void QmitkDIAppDicomImportPerspective::CreateInitialLayout(berry::IPageLayout::Pointer layout) -{ - ///////////////////////////////////////////////////// - // all di-app perspectives should have the following: - ///////////////////////////////////////////////////// - - std::string editorArea = layout->GetEditorArea(); - - layout->AddStandaloneView("org.mitk.views.datamanager", - false, berry::IPageLayout::LEFT, 0.3f, editorArea); - - layout->AddStandaloneView("org.mitk.views.controlvisualizationpropertiesview", - false, berry::IPageLayout::BOTTOM, .15f, "org.mitk.views.datamanager"); - - berry::IFolderLayout::Pointer left = - layout->CreateFolder("org.mbi.diffusionimaginginternal.leftcontrols", - berry::IPageLayout::BOTTOM, 0.1f, "org.mitk.views.controlvisualizationpropertiesview"); - - layout->AddStandaloneViewPlaceholder("org.mitk.views.imagenavigator", - berry::IPageLayout::BOTTOM, .4f, "org.mbi.diffusionimaginginternal.leftcontrols", false); - - ///////////////////////////////////////////// - // here goes the perspective specific stuff - ///////////////////////////////////////////// - - left->AddView("org.mitk.views.diffusiondicomimport"); - berry::IViewLayout::Pointer lo = layout->GetViewLayout("org.mitk.views.diffusiondicomimport"); - - -} diff --git a/Plugins/org.mitk.gui.qt.diffusionimagingapp/src/internal/Perspectives/QmitkDIAppDicomImportPerspective.h b/Plugins/org.mitk.gui.qt.diffusionimagingapp/src/internal/Perspectives/QmitkDIAppDicomImportPerspective.h deleted file mode 100644 index ddc72a165b..0000000000 --- a/Plugins/org.mitk.gui.qt.diffusionimagingapp/src/internal/Perspectives/QmitkDIAppDicomImportPerspective.h +++ /dev/null @@ -1,36 +0,0 @@ -/*=================================================================== - -The Medical Imaging Interaction Toolkit (MITK) - -Copyright (c) German Cancer Research Center, -Division of Medical and Biological Informatics. -All rights reserved. - -This software is distributed WITHOUT ANY WARRANTY; without -even the implied warranty of MERCHANTABILITY or FITNESS FOR -A PARTICULAR PURPOSE. - -See LICENSE.txt or http://www.mitk.org for details. - -===================================================================*/ - - -#ifndef QmitkDIAppDicomImportPerspective_H_ -#define QmitkDIAppDicomImportPerspective_H_ - -#include - -class QmitkDIAppDicomImportPerspective : public QObject, public berry::IPerspectiveFactory -{ - Q_OBJECT - Q_INTERFACES(berry::IPerspectiveFactory) - -public: - - QmitkDIAppDicomImportPerspective() {} - ~QmitkDIAppDicomImportPerspective() {} - - void CreateInitialLayout(berry::IPageLayout::Pointer layout); -}; - -#endif /* QmitkDIAppDicomImportPerspective_H_ */ diff --git a/Plugins/org.mitk.gui.qt.diffusionimagingapp/src/internal/Perspectives/QmitkDIAppIVIMPerspective.cpp b/Plugins/org.mitk.gui.qt.diffusionimagingapp/src/internal/Perspectives/QmitkDIAppIVIMPerspective.cpp deleted file mode 100644 index dfee30f216..0000000000 --- a/Plugins/org.mitk.gui.qt.diffusionimagingapp/src/internal/Perspectives/QmitkDIAppIVIMPerspective.cpp +++ /dev/null @@ -1,52 +0,0 @@ -/*=================================================================== - -The Medical Imaging Interaction Toolkit (MITK) - -Copyright (c) German Cancer Research Center, -Division of Medical and Biological Informatics. -All rights reserved. - -This software is distributed WITHOUT ANY WARRANTY; without -even the implied warranty of MERCHANTABILITY or FITNESS FOR -A PARTICULAR PURPOSE. - -See LICENSE.txt or http://www.mitk.org for details. - -===================================================================*/ - -#include "QmitkDIAppIVIMPerspective.h" -#include "berryIViewLayout.h" - -void QmitkDIAppIVIMPerspective::CreateInitialLayout(berry::IPageLayout::Pointer layout) -{ - ///////////////////////////////////////////////////// - // all di-app perspectives should have the following: - ///////////////////////////////////////////////////// - - std::string editorArea = layout->GetEditorArea(); - - layout->AddStandaloneView("org.mitk.views.datamanager", - false, berry::IPageLayout::LEFT, 0.3f, editorArea); - - layout->AddStandaloneView("org.mitk.views.controlvisualizationpropertiesview", - false, berry::IPageLayout::BOTTOM, .15f, "org.mitk.views.datamanager"); - - berry::IFolderLayout::Pointer left = - layout->CreateFolder("org.mbi.diffusionimaginginternal.leftcontrols", - berry::IPageLayout::BOTTOM, 0.1f, "org.mitk.views.controlvisualizationpropertiesview"); - - layout->AddStandaloneViewPlaceholder("org.mitk.views.imagenavigator", - berry::IPageLayout::BOTTOM, .4f, "org.mbi.diffusionimaginginternal.leftcontrols", false); - - ///////////////////////////////////////////// - // here goes the perspective specific stuff - ///////////////////////////////////////////// - - left->AddView("org.mitk.views.ivim"); - berry::IViewLayout::Pointer lo = layout->GetViewLayout("org.mitk.views.ivim"); - - - left->AddView("org.mitk.views.segmentation"); - lo = layout->GetViewLayout("org.mitk.views.segmentation"); - -} diff --git a/Plugins/org.mitk.gui.qt.diffusionimagingapp/src/internal/Perspectives/QmitkDIAppImageProcessingPerspective.cpp b/Plugins/org.mitk.gui.qt.diffusionimagingapp/src/internal/Perspectives/QmitkDIAppImageProcessingPerspective.cpp deleted file mode 100644 index b56b29b31d..0000000000 --- a/Plugins/org.mitk.gui.qt.diffusionimagingapp/src/internal/Perspectives/QmitkDIAppImageProcessingPerspective.cpp +++ /dev/null @@ -1,56 +0,0 @@ -/*=================================================================== - -The Medical Imaging Interaction Toolkit (MITK) - -Copyright (c) German Cancer Research Center, -Division of Medical and Biological Informatics. -All rights reserved. - -This software is distributed WITHOUT ANY WARRANTY; without -even the implied warranty of MERCHANTABILITY or FITNESS FOR -A PARTICULAR PURPOSE. - -See LICENSE.txt or http://www.mitk.org for details. - -===================================================================*/ - -#include "QmitkDIAppImageProcessingPerspective.h" -#include "berryIViewLayout.h" - -void QmitkDIAppImageProcessingPerspective::CreateInitialLayout(berry::IPageLayout::Pointer layout) -{ - ///////////////////////////////////////////////////// - // all di-app perspectives should have the following: - ///////////////////////////////////////////////////// - - std::string editorArea = layout->GetEditorArea(); - - layout->AddStandaloneView("org.mitk.views.datamanager", - false, berry::IPageLayout::LEFT, 0.3f, editorArea); - - layout->AddStandaloneView("org.mitk.views.controlvisualizationpropertiesview", - false, berry::IPageLayout::BOTTOM, 0.15f, "org.mitk.views.datamanager"); - - berry::IFolderLayout::Pointer left = - layout->CreateFolder("org.mbi.diffusionimaginginternal.leftcontrols", - berry::IPageLayout::BOTTOM, 0.1f, "org.mitk.views.controlvisualizationpropertiesview"); - - layout->AddStandaloneViewPlaceholder("org.mitk.views.imagenavigator", - berry::IPageLayout::BOTTOM, .4f, "org.mbi.diffusionimaginginternal.leftcontrols", false); - - ///////////////////////////////////////////// - // here goes the perspective specific stuff - ///////////////////////////////////////////// - - left->AddView("org.mitk.views.segmentation"); - berry::IViewLayout::Pointer lo = layout->GetViewLayout("org.mitk.views.segmentation"); - - - left->AddView("org.mitk.views.segmentationutilities"); - lo = layout->GetViewLayout("org.mitk.views.segmentationutilities"); - - - left->AddView("org.mitk.views.basicimageprocessing"); - lo = layout->GetViewLayout("org.mitk.views.basicimageprocessing"); - -} diff --git a/Plugins/org.mitk.gui.qt.diffusionimagingapp/src/internal/Perspectives/QmitkDIAppPreprocessingReconstructionPerspective.cpp b/Plugins/org.mitk.gui.qt.diffusionimagingapp/src/internal/Perspectives/QmitkDIAppPreprocessingReconstructionPerspective.cpp deleted file mode 100644 index c74d6cba29..0000000000 --- a/Plugins/org.mitk.gui.qt.diffusionimagingapp/src/internal/Perspectives/QmitkDIAppPreprocessingReconstructionPerspective.cpp +++ /dev/null @@ -1,76 +0,0 @@ -/*=================================================================== - -The Medical Imaging Interaction Toolkit (MITK) - -Copyright (c) German Cancer Research Center, -Division of Medical and Biological Informatics. -All rights reserved. - -This software is distributed WITHOUT ANY WARRANTY; without -even the implied warranty of MERCHANTABILITY or FITNESS FOR -A PARTICULAR PURPOSE. - -See LICENSE.txt or http://www.mitk.org for details. - -===================================================================*/ - -#include "QmitkDIAppPreprocessingReconstructionPerspective.h" -#include "berryIViewLayout.h" - -void QmitkDIAppPreprocessingReconstructionPerspective::CreateInitialLayout(berry::IPageLayout::Pointer layout) -{ - std::string editorArea = layout->GetEditorArea(); - - layout->AddStandaloneView("org.mitk.views.datamanager", - false, berry::IPageLayout::LEFT, 0.3f, editorArea); - - layout->AddStandaloneView("org.mitk.views.controlvisualizationpropertiesview", - false, berry::IPageLayout::BOTTOM, .15f, "org.mitk.views.datamanager"); - - berry::IFolderLayout::Pointer left = - layout->CreateFolder("org.mitk.views.leftcontrols2", - berry::IPageLayout::BOTTOM, 0.1f, "org.mitk.views.controlvisualizationpropertiesview"); - - berry::IFolderLayout::Pointer bottomleft = - layout->CreateFolder("org.mitk.views.leftcontrols", - berry::IPageLayout::BOTTOM, 0.5f, "org.mitk.views.leftcontrols2"); - - layout->AddStandaloneViewPlaceholder("org.mitk.views.imagenavigator", - berry::IPageLayout::BOTTOM, .6f, "org.mitk.views.leftcontrols", false); - - ///////////////////////////////////////////// - // add the views - ///////////////////////////////////////////// - - left->AddView("org.mitk.views.diffusionpreprocessing"); - berry::IViewLayout::Pointer lo = layout->GetViewLayout("org.mitk.views.diffusionpreprocessing"); - - - left->AddView("org.mitk.views.diffusionregistrationview"); - lo = layout->GetViewLayout("org.mitk.views.diffusionregistrationview"); - - - left->AddView("org.mitk.views.tensorreconstruction"); - lo = layout->GetViewLayout("org.mitk.views.tensorreconstruction"); - - - left->AddView("org.mitk.views.qballreconstruction"); - lo = layout->GetViewLayout("org.mitk.views.qballreconstruction"); - - - bottomleft->AddView("org.mitk.views.diffusionquantification"); - berry::IViewLayout::Pointer lo2 = layout->GetViewLayout("org.mitk.views.diffusionquantification"); - lo2->SetCloseable(false); - - bottomleft->AddView("org.mitk.views.odfmaximaextraction"); - lo2 = layout->GetViewLayout("org.mitk.views.odfmaximaextraction"); - lo2->SetCloseable(false); - - bottomleft->AddView("org.mitk.views.odfdetails"); - lo2 = layout->GetViewLayout("org.mitk.views.odfdetails"); - lo2->SetCloseable(false); - - bottomleft->AddView("org.mitk.views.denoisingview"); - lo2 = layout->GetViewLayout("org.mitk.views.denoisingview"); - lo2->SetCloseable(false); -} diff --git a/Plugins/org.mitk.gui.qt.diffusionimagingapp/src/internal/Perspectives/QmitkDIAppPreprocessingReconstructionPerspective.h b/Plugins/org.mitk.gui.qt.diffusionimagingapp/src/internal/Perspectives/QmitkDIAppPreprocessingReconstructionPerspective.h deleted file mode 100644 index fc57cbc846..0000000000 --- a/Plugins/org.mitk.gui.qt.diffusionimagingapp/src/internal/Perspectives/QmitkDIAppPreprocessingReconstructionPerspective.h +++ /dev/null @@ -1,36 +0,0 @@ -/*=================================================================== - -The Medical Imaging Interaction Toolkit (MITK) - -Copyright (c) German Cancer Research Center, -Division of Medical and Biological Informatics. -All rights reserved. - -This software is distributed WITHOUT ANY WARRANTY; without -even the implied warranty of MERCHANTABILITY or FITNESS FOR -A PARTICULAR PURPOSE. - -See LICENSE.txt or http://www.mitk.org for details. - -===================================================================*/ - - -#ifndef QmitkDIAppPreprocessingReconstructionPerspective_H_ -#define QmitkDIAppPreprocessingReconstructionPerspective_H_ - -#include - -class QmitkDIAppPreprocessingReconstructionPerspective : public QObject, public berry::IPerspectiveFactory -{ - Q_OBJECT - Q_INTERFACES(berry::IPerspectiveFactory) - -public: - - QmitkDIAppPreprocessingReconstructionPerspective() {} - ~QmitkDIAppPreprocessingReconstructionPerspective() {} - - void CreateInitialLayout(berry::IPageLayout::Pointer layout); -}; - -#endif /* QmitkDIAppPreprocessingReconstructionPerspective_H_ */ diff --git a/Plugins/org.mitk.gui.qt.diffusionimagingapp/src/internal/Perspectives/QmitkDIAppQuantificationPerspective.cpp b/Plugins/org.mitk.gui.qt.diffusionimagingapp/src/internal/Perspectives/QmitkDIAppQuantificationPerspective.cpp deleted file mode 100644 index 19c2f4d3bc..0000000000 --- a/Plugins/org.mitk.gui.qt.diffusionimagingapp/src/internal/Perspectives/QmitkDIAppQuantificationPerspective.cpp +++ /dev/null @@ -1,60 +0,0 @@ -/*=================================================================== - -The Medical Imaging Interaction Toolkit (MITK) - -Copyright (c) German Cancer Research Center, -Division of Medical and Biological Informatics. -All rights reserved. - -This software is distributed WITHOUT ANY WARRANTY; without -even the implied warranty of MERCHANTABILITY or FITNESS FOR -A PARTICULAR PURPOSE. - -See LICENSE.txt or http://www.mitk.org for details. - -===================================================================*/ - -#include "QmitkDIAppQuantificationPerspective.h" -#include "berryIViewLayout.h" - -void QmitkDIAppQuantificationPerspective::CreateInitialLayout(berry::IPageLayout::Pointer layout) -{ - ///////////////////////////////////////////////////// - // all di-app perspectives should have the following: - ///////////////////////////////////////////////////// - - std::string editorArea = layout->GetEditorArea(); - - layout->AddStandaloneView("org.mitk.views.datamanager", - false, berry::IPageLayout::LEFT, 0.3f, editorArea); - - layout->AddStandaloneView("org.mitk.views.controlvisualizationpropertiesview", - false, berry::IPageLayout::BOTTOM, .15f, "org.mitk.views.datamanager"); - - berry::IFolderLayout::Pointer left = - layout->CreateFolder("org.mbi.diffusionimaginginternal.leftcontrols", - berry::IPageLayout::BOTTOM, 0.1f, "org.mitk.views.controlvisualizationpropertiesview"); - - layout->AddStandaloneViewPlaceholder("org.mitk.views.imagenavigator", - berry::IPageLayout::BOTTOM, .4f, "org.mbi.diffusionimaginginternal.leftcontrols", false); - - ///////////////////////////////////////////// - // here goes the perspective specific stuff - ///////////////////////////////////////////// - - left->AddView("org.mitk.views.partialvolumeanalysisview"); - berry::IViewLayout::Pointer lo = layout->GetViewLayout("org.mitk.views.partialvolumeanalysisview"); - - - left->AddView("org.mitk.views.tractbasedspatialstatistics"); - lo = layout->GetViewLayout("org.mitk.views.tractbasedspatialstatistics"); - - - left->AddView("org.mitk.views.imagestatistics"); - lo = layout->GetViewLayout("org.mitk.views.imagestatistics"); - - - left->AddView("org.mitk.views.measurement"); - lo = layout->GetViewLayout("org.mitk.views.measurement"); - -} diff --git a/Plugins/org.mitk.gui.qt.diffusionimagingapp/src/internal/Perspectives/QmitkDIAppQuantificationPerspective.h b/Plugins/org.mitk.gui.qt.diffusionimagingapp/src/internal/Perspectives/QmitkDIAppQuantificationPerspective.h deleted file mode 100644 index e4db63ae9d..0000000000 --- a/Plugins/org.mitk.gui.qt.diffusionimagingapp/src/internal/Perspectives/QmitkDIAppQuantificationPerspective.h +++ /dev/null @@ -1,36 +0,0 @@ -/*=================================================================== - -The Medical Imaging Interaction Toolkit (MITK) - -Copyright (c) German Cancer Research Center, -Division of Medical and Biological Informatics. -All rights reserved. - -This software is distributed WITHOUT ANY WARRANTY; without -even the implied warranty of MERCHANTABILITY or FITNESS FOR -A PARTICULAR PURPOSE. - -See LICENSE.txt or http://www.mitk.org for details. - -===================================================================*/ - - -#ifndef QmitkDIAppQuantificationPerspective_H_ -#define QmitkDIAppQuantificationPerspective_H_ - -#include - -class QmitkDIAppQuantificationPerspective : public QObject, public berry::IPerspectiveFactory -{ - Q_OBJECT - Q_INTERFACES(berry::IPerspectiveFactory) - -public: - - QmitkDIAppQuantificationPerspective() {} - ~QmitkDIAppQuantificationPerspective() {} - - void CreateInitialLayout(berry::IPageLayout::Pointer layout); -}; - -#endif /* QmitkDIAppQuantificationPerspective_H_ */ diff --git a/Plugins/org.mitk.gui.qt.diffusionimagingapp/src/internal/Perspectives/QmitkDIAppRegistrationPerspective.cpp b/Plugins/org.mitk.gui.qt.diffusionimagingapp/src/internal/Perspectives/QmitkDIAppRegistrationPerspective.cpp deleted file mode 100644 index befc5502f8..0000000000 --- a/Plugins/org.mitk.gui.qt.diffusionimagingapp/src/internal/Perspectives/QmitkDIAppRegistrationPerspective.cpp +++ /dev/null @@ -1,56 +0,0 @@ -/*=================================================================== - -The Medical Imaging Interaction Toolkit (MITK) - -Copyright (c) German Cancer Research Center, -Division of Medical and Biological Informatics. -All rights reserved. - -This software is distributed WITHOUT ANY WARRANTY; without -even the implied warranty of MERCHANTABILITY or FITNESS FOR -A PARTICULAR PURPOSE. - -See LICENSE.txt or http://www.mitk.org for details. - -===================================================================*/ - -#include "QmitkDIAppRegistrationPerspective.h" -#include "berryIViewLayout.h" - -void QmitkDIAppRegistrationPerspective::CreateInitialLayout(berry::IPageLayout::Pointer layout) -{ - ///////////////////////////////////////////////////// - // all di-app perspectives should have the following: - ///////////////////////////////////////////////////// - - std::string editorArea = layout->GetEditorArea(); - - layout->AddStandaloneView("org.mitk.views.datamanager", - false, berry::IPageLayout::LEFT, 0.3f, editorArea); - - layout->AddStandaloneView("org.mitk.views.controlvisualizationpropertiesview", - false, berry::IPageLayout::BOTTOM, .15f, "org.mitk.views.datamanager"); - - berry::IFolderLayout::Pointer left = - layout->CreateFolder("org.mbi.diffusionimaginginternal.leftcontrols", - berry::IPageLayout::BOTTOM, 0.1f, "org.mitk.views.controlvisualizationpropertiesview"); - - layout->AddStandaloneViewPlaceholder("org.mitk.views.imagenavigator", - berry::IPageLayout::BOTTOM, .4f, "org.mbi.diffusionimaginginternal.leftcontrols", false); - - ///////////////////////////////////////////// - // here goes the perspective specific stuff - ///////////////////////////////////////////// - - left->AddView("org.mitk.views.rigidregistration"); - berry::IViewLayout::Pointer lo = layout->GetViewLayout("org.mitk.views.rigidregistration"); - - - left->AddView("org.mitk.views.pointbasedregistration"); - lo = layout->GetViewLayout("org.mitk.views.pointbasedregistration"); - - - left->AddView("org.mitk.views.diffusionregistrationview"); - lo = layout->GetViewLayout("org.mitk.views.diffusionregistrationview"); - -} diff --git a/Plugins/org.mitk.gui.qt.diffusionimagingapp/src/internal/Perspectives/QmitkDIAppRegistrationPerspective.h b/Plugins/org.mitk.gui.qt.diffusionimagingapp/src/internal/Perspectives/QmitkDIAppRegistrationPerspective.h deleted file mode 100644 index 241717aa0d..0000000000 --- a/Plugins/org.mitk.gui.qt.diffusionimagingapp/src/internal/Perspectives/QmitkDIAppRegistrationPerspective.h +++ /dev/null @@ -1,36 +0,0 @@ -/*=================================================================== - -The Medical Imaging Interaction Toolkit (MITK) - -Copyright (c) German Cancer Research Center, -Division of Medical and Biological Informatics. -All rights reserved. - -This software is distributed WITHOUT ANY WARRANTY; without -even the implied warranty of MERCHANTABILITY or FITNESS FOR -A PARTICULAR PURPOSE. - -See LICENSE.txt or http://www.mitk.org for details. - -===================================================================*/ - - -#ifndef QmitkDIAppRegistrationPerspective_H_ -#define QmitkDIAppRegistrationPerspective_H_ - -#include - -class QmitkDIAppRegistrationPerspective : public QObject, public berry::IPerspectiveFactory -{ - Q_OBJECT - Q_INTERFACES(berry::IPerspectiveFactory) - -public: - - QmitkDIAppRegistrationPerspective() {} - ~QmitkDIAppRegistrationPerspective() {} - - void CreateInitialLayout(berry::IPageLayout::Pointer layout); -}; - -#endif /* QmitkDIAppRegistrationPerspective_H_ */ diff --git a/Plugins/org.mitk.gui.qt.diffusionimagingapp/src/internal/Perspectives/QmitkDIAppSyntheticDataGenerationPerspective.cpp b/Plugins/org.mitk.gui.qt.diffusionimagingapp/src/internal/Perspectives/QmitkDIAppSyntheticDataGenerationPerspective.cpp deleted file mode 100644 index d8bc4d590c..0000000000 --- a/Plugins/org.mitk.gui.qt.diffusionimagingapp/src/internal/Perspectives/QmitkDIAppSyntheticDataGenerationPerspective.cpp +++ /dev/null @@ -1,64 +0,0 @@ -/*=================================================================== - -The Medical Imaging Interaction Toolkit (MITK) - -Copyright (c) German Cancer Research Center, -Division of Medical and Biological Informatics. -All rights reserved. - -This software is distributed WITHOUT ANY WARRANTY; without -even the implied warranty of MERCHANTABILITY or FITNESS FOR -A PARTICULAR PURPOSE. - -See LICENSE.txt or http://www.mitk.org for details. - -===================================================================*/ - -#include "QmitkDIAppSyntheticDataGenerationPerspective.h" -#include "berryIViewLayout.h" - -void QmitkDIAppSyntheticDataGenerationPerspective::CreateInitialLayout(berry::IPageLayout::Pointer layout) -{ - ///////////////////////////////////////////////////// - // all di-app perspectives should have the following: - ///////////////////////////////////////////////////// - - std::string editorArea = layout->GetEditorArea(); - - layout->AddStandaloneView("org.mitk.views.datamanager", - false, berry::IPageLayout::LEFT, 0.3f, editorArea); - - layout->AddStandaloneView("org.mitk.views.controlvisualizationpropertiesview", - false, berry::IPageLayout::BOTTOM, .15f, "org.mitk.views.datamanager"); - - berry::IFolderLayout::Pointer left = - layout->CreateFolder("org.mbi.diffusionimaginginternal.leftcontrols", - berry::IPageLayout::BOTTOM, 0.1f, "org.mitk.views.controlvisualizationpropertiesview"); - - layout->AddStandaloneViewPlaceholder("org.mitk.views.imagenavigator", - berry::IPageLayout::BOTTOM, .4f, "org.mbi.diffusionimaginginternal.leftcontrols", false); - - ///////////////////////////////////////////// - // here goes the perspective specific stuff - ///////////////////////////////////////////// - - left->AddView("org.mitk.views.fiberfoxview"); - berry::IViewLayout::Pointer lo = layout->GetViewLayout("org.mitk.views.fiberfoxview"); - - - left->AddView("org.mitk.views.fiberprocessing"); - lo = layout->GetViewLayout("org.mitk.views.fiberprocessing"); - - - left->AddView("org.mitk.views.fiberextraction"); - lo = layout->GetViewLayout("org.mitk.views.fiberextraction"); - - - left->AddView("org.mitk.views.fieldmapgenerator"); - lo = layout->GetViewLayout("org.mitk.views.fieldmapgenerator"); - - - left->AddView("org.mitk.views.segmentation"); - lo = layout->GetViewLayout("org.mitk.views.segmentation"); - -} diff --git a/Plugins/org.mitk.gui.qt.diffusionimagingapp/src/internal/Perspectives/QmitkDIAppTBSSPerspective.cpp b/Plugins/org.mitk.gui.qt.diffusionimagingapp/src/internal/Perspectives/QmitkDIAppTBSSPerspective.cpp deleted file mode 100644 index d6ad86179f..0000000000 --- a/Plugins/org.mitk.gui.qt.diffusionimagingapp/src/internal/Perspectives/QmitkDIAppTBSSPerspective.cpp +++ /dev/null @@ -1,49 +0,0 @@ -/*=================================================================== - -The Medical Imaging Interaction Toolkit (MITK) - -Copyright (c) German Cancer Research Center, -Division of Medical and Biological Informatics. -All rights reserved. - -This software is distributed WITHOUT ANY WARRANTY; without -even the implied warranty of MERCHANTABILITY or FITNESS FOR -A PARTICULAR PURPOSE. - -See LICENSE.txt or http://www.mitk.org for details. - -===================================================================*/ - -#include "QmitkDIAppTBSSPerspective.h" -#include "berryIViewLayout.h" - -void QmitkDIAppTBSSPerspective::CreateInitialLayout(berry::IPageLayout::Pointer layout) -{ - ///////////////////////////////////////////////////// - // all di-app perspectives should have the following: - ///////////////////////////////////////////////////// - - std::string editorArea = layout->GetEditorArea(); - - layout->AddStandaloneView("org.mitk.views.datamanager", - false, berry::IPageLayout::LEFT, 0.3f, editorArea); - - layout->AddStandaloneView("org.mitk.views.controlvisualizationpropertiesview", - false, berry::IPageLayout::BOTTOM, .15f, "org.mitk.views.datamanager"); - - berry::IFolderLayout::Pointer left = - layout->CreateFolder("org.mbi.diffusionimaginginternal.leftcontrols", - berry::IPageLayout::BOTTOM, 0.1f, "org.mitk.views.controlvisualizationpropertiesview"); - - layout->AddStandaloneViewPlaceholder("org.mitk.views.imagenavigator", - berry::IPageLayout::BOTTOM, .4f, "org.mbi.diffusionimaginginternal.leftcontrols", false); - - ///////////////////////////////////////////// - // here goes the perspective specific stuff - ///////////////////////////////////////////// - - left->AddView("org.mitk.views.tractbasedspatialstatistics"); - berry::IViewLayout::Pointer lo = layout->GetViewLayout("org.mitk.views.tractbasedspatialstatistics"); - - -} diff --git a/Plugins/org.mitk.gui.qt.diffusionimagingapp/src/internal/Perspectives/QmitkDIAppTrackingEvaluationPerspective.cpp b/Plugins/org.mitk.gui.qt.diffusionimagingapp/src/internal/Perspectives/QmitkDIAppTrackingEvaluationPerspective.cpp deleted file mode 100644 index 184abd2bc0..0000000000 --- a/Plugins/org.mitk.gui.qt.diffusionimagingapp/src/internal/Perspectives/QmitkDIAppTrackingEvaluationPerspective.cpp +++ /dev/null @@ -1,48 +0,0 @@ -/*=================================================================== - -The Medical Imaging Interaction Toolkit (MITK) - -Copyright (c) German Cancer Research Center, -Division of Medical and Biological Informatics. -All rights reserved. - -This software is distributed WITHOUT ANY WARRANTY; without -even the implied warranty of MERCHANTABILITY or FITNESS FOR -A PARTICULAR PURPOSE. - -See LICENSE.txt or http://www.mitk.org for details. - -===================================================================*/ - -#include "QmitkDIAppTrackingEvaluationPerspective.h" -#include "berryIViewLayout.h" - -void QmitkDIAppTrackingEvaluationPerspective::CreateInitialLayout(berry::IPageLayout::Pointer layout) -{ - ///////////////////////////////////////////////////// - // all di-app perspectives should have the following: - ///////////////////////////////////////////////////// - - std::string editorArea = layout->GetEditorArea(); - - layout->AddStandaloneView("org.mitk.views.datamanager", - false, berry::IPageLayout::LEFT, 0.3f, editorArea); - - layout->AddStandaloneView("org.mitk.views.controlvisualizationpropertiesview", - false, berry::IPageLayout::BOTTOM, .15f, "org.mitk.views.datamanager"); - - berry::IFolderLayout::Pointer left = - layout->CreateFolder("org.mitk.diffusionimaginginternal.leftcontrols", - berry::IPageLayout::BOTTOM, 0.1f, "org.mitk.views.controlvisualizationpropertiesview"); - - layout->AddStandaloneViewPlaceholder("org.mitk.views.imagenavigator", - berry::IPageLayout::BOTTOM, .4f, "org.mbi.diffusionimaginginternal.leftcontrols", false); - - ///////////////////////////////////////////// - // here goes the perspective specific stuff - ///////////////////////////////////////////// - - left->AddView("org.mitk.views.artificialqballevaluation"); - berry::IViewLayout::Pointer lo = layout->GetViewLayout("org.mitk.views.artificialqballevaluation"); - -} diff --git a/Plugins/org.mitk.gui.qt.diffusionimagingapp/src/internal/Perspectives/QmitkDIAppTrackingEvaluationPerspective.h b/Plugins/org.mitk.gui.qt.diffusionimagingapp/src/internal/Perspectives/QmitkDIAppTrackingEvaluationPerspective.h deleted file mode 100644 index 59be7e3311..0000000000 --- a/Plugins/org.mitk.gui.qt.diffusionimagingapp/src/internal/Perspectives/QmitkDIAppTrackingEvaluationPerspective.h +++ /dev/null @@ -1,36 +0,0 @@ -/*=================================================================== - -The Medical Imaging Interaction Toolkit (MITK) - -Copyright (c) German Cancer Research Center, -Division of Medical and Biological Informatics. -All rights reserved. - -This software is distributed WITHOUT ANY WARRANTY; without -even the implied warranty of MERCHANTABILITY or FITNESS FOR -A PARTICULAR PURPOSE. - -See LICENSE.txt or http://www.mitk.org for details. - -===================================================================*/ - - -#ifndef QmitkDIAppTrackingEvaluationPerspective_H_ -#define QmitkDIAppTrackingEvaluationPerspective_H_ - -#include - -class QmitkDIAppTrackingEvaluationPerspective : public QObject, public berry::IPerspectiveFactory -{ - Q_OBJECT - Q_INTERFACES(berry::IPerspectiveFactory) - -public: - - QmitkDIAppTrackingEvaluationPerspective() {} - ~QmitkDIAppTrackingEvaluationPerspective() {} - - void CreateInitialLayout(berry::IPageLayout::Pointer layout); -}; - -#endif /* QmitkDIAppTrackingEvaluationPerspective_H_ */ diff --git a/Plugins/org.mitk.gui.qt.diffusionimagingapp/src/internal/Perspectives/QmitkDIAppUtilityPerspective.cpp b/Plugins/org.mitk.gui.qt.diffusionimagingapp/src/internal/Perspectives/QmitkDIAppUtilityPerspective.cpp deleted file mode 100644 index c553c04c07..0000000000 --- a/Plugins/org.mitk.gui.qt.diffusionimagingapp/src/internal/Perspectives/QmitkDIAppUtilityPerspective.cpp +++ /dev/null @@ -1,52 +0,0 @@ -/*=================================================================== - -The Medical Imaging Interaction Toolkit (MITK) - -Copyright (c) German Cancer Research Center, -Division of Medical and Biological Informatics. -All rights reserved. - -This software is distributed WITHOUT ANY WARRANTY; without -even the implied warranty of MERCHANTABILITY or FITNESS FOR -A PARTICULAR PURPOSE. - -See LICENSE.txt or http://www.mitk.org for details. - -===================================================================*/ - -#include "QmitkDIAppUtilityPerspective.h" -#include "berryIViewLayout.h" - -void QmitkDIAppUtilityPerspective::CreateInitialLayout(berry::IPageLayout::Pointer layout) -{ - ///////////////////////////////////////////////////// - // all di-app perspectives should have the following: - ///////////////////////////////////////////////////// - - std::string editorArea = layout->GetEditorArea(); - - layout->AddStandaloneView("org.mitk.views.datamanager", - false, berry::IPageLayout::LEFT, 0.3f, editorArea); - - layout->AddStandaloneView("org.mitk.views.controlvisualizationpropertiesview", - false, berry::IPageLayout::BOTTOM, .15f, "org.mitk.views.datamanager"); - - berry::IFolderLayout::Pointer left = - layout->CreateFolder("org.mbi.diffusionimaginginternal.leftcontrols", - berry::IPageLayout::BOTTOM, 0.1f, "org.mitk.views.controlvisualizationpropertiesview"); - - layout->AddStandaloneViewPlaceholder("org.mitk.views.imagenavigator", - berry::IPageLayout::BOTTOM, .4f, "org.mbi.diffusionimaginginternal.leftcontrols", false); - - ///////////////////////////////////////////// - // here goes the perspective specific stuff - ///////////////////////////////////////////// - - left->AddView("org.mitk.views.properties"); - berry::IViewLayout::Pointer lo = layout->GetViewLayout("org.mitk.views.properties"); - - - left->AddView("org.blueberry.views.logview"); - lo = layout->GetViewLayout("org.blueberry.views.logview"); - -} diff --git a/Plugins/org.mitk.gui.qt.diffusionimagingapp/src/internal/Perspectives/QmitkDIAppVisualizationPerspective.cpp b/Plugins/org.mitk.gui.qt.diffusionimagingapp/src/internal/Perspectives/QmitkDIAppVisualizationPerspective.cpp deleted file mode 100644 index 7788a6f47f..0000000000 --- a/Plugins/org.mitk.gui.qt.diffusionimagingapp/src/internal/Perspectives/QmitkDIAppVisualizationPerspective.cpp +++ /dev/null @@ -1,56 +0,0 @@ -/*=================================================================== - -The Medical Imaging Interaction Toolkit (MITK) - -Copyright (c) German Cancer Research Center, -Division of Medical and Biological Informatics. -All rights reserved. - -This software is distributed WITHOUT ANY WARRANTY; without -even the implied warranty of MERCHANTABILITY or FITNESS FOR -A PARTICULAR PURPOSE. - -See LICENSE.txt or http://www.mitk.org for details. - -===================================================================*/ - -#include "QmitkDIAppVisualizationPerspective.h" -#include "berryIViewLayout.h" - -void QmitkDIAppVisualizationPerspective::CreateInitialLayout(berry::IPageLayout::Pointer layout) -{ - ///////////////////////////////////////////////////// - // all di-app perspectives should have the following: - ///////////////////////////////////////////////////// - - std::string editorArea = layout->GetEditorArea(); - - layout->AddStandaloneView("org.mitk.views.datamanager", - false, berry::IPageLayout::LEFT, 0.3f, editorArea); - - layout->AddStandaloneView("org.mitk.views.controlvisualizationpropertiesview", - false, berry::IPageLayout::BOTTOM, .15f, "org.mitk.views.datamanager"); - - berry::IFolderLayout::Pointer left = - layout->CreateFolder("org.mbi.diffusionimaginginternal.leftcontrols", - berry::IPageLayout::BOTTOM, 0.1f, "org.mitk.views.controlvisualizationpropertiesview"); - - layout->AddStandaloneViewPlaceholder("org.mitk.views.imagenavigator", - berry::IPageLayout::BOTTOM, .4f, "org.mbi.diffusionimaginginternal.leftcontrols", false); - - ///////////////////////////////////////////// - // here goes the perspective specific stuff - ///////////////////////////////////////////// - - left->AddView("org.mitk.views.volumevisualization"); - berry::IViewLayout::Pointer lo = layout->GetViewLayout("org.mitk.views.volumevisualization"); - - - left->AddView("org.mitk.views.screenshotmaker"); - lo = layout->GetViewLayout("org.mitk.views.screenshotmaker"); - - - left->AddView("org.mitk.views.moviemaker"); - lo = layout->GetViewLayout("org.mitk.views.moviemaker"); - -} diff --git a/Plugins/org.mitk.gui.qt.diffusionimagingapp/src/internal/Perspectives/QmitkDIAppVisualizationPerspective.h b/Plugins/org.mitk.gui.qt.diffusionimagingapp/src/internal/Perspectives/QmitkDIAppVisualizationPerspective.h deleted file mode 100644 index 31821060d9..0000000000 --- a/Plugins/org.mitk.gui.qt.diffusionimagingapp/src/internal/Perspectives/QmitkDIAppVisualizationPerspective.h +++ /dev/null @@ -1,36 +0,0 @@ -/*=================================================================== - -The Medical Imaging Interaction Toolkit (MITK) - -Copyright (c) German Cancer Research Center, -Division of Medical and Biological Informatics. -All rights reserved. - -This software is distributed WITHOUT ANY WARRANTY; without -even the implied warranty of MERCHANTABILITY or FITNESS FOR -A PARTICULAR PURPOSE. - -See LICENSE.txt or http://www.mitk.org for details. - -===================================================================*/ - - -#ifndef QmitkDIAppVisualizationPerspective_H_ -#define QmitkDIAppVisualizationPerspective_H_ - -#include - -class QmitkDIAppVisualizationPerspective : public QObject, public berry::IPerspectiveFactory -{ - Q_OBJECT - Q_INTERFACES(berry::IPerspectiveFactory) - -public: - - QmitkDIAppVisualizationPerspective() {} - ~QmitkDIAppVisualizationPerspective() {} - - void CreateInitialLayout(berry::IPageLayout::Pointer layout); -}; - -#endif /* QmitkDIAppVisualizationPerspective_H_ */ diff --git a/Plugins/org.mitk.gui.qt.diffusionimagingapp/src/internal/Perspectives/QmitkDiffusionImagingAppPerspective.cpp b/Plugins/org.mitk.gui.qt.diffusionimagingapp/src/internal/Perspectives/QmitkDiffusionImagingAppPerspective.cpp deleted file mode 100644 index 4a5e27efdb..0000000000 --- a/Plugins/org.mitk.gui.qt.diffusionimagingapp/src/internal/Perspectives/QmitkDiffusionImagingAppPerspective.cpp +++ /dev/null @@ -1,49 +0,0 @@ -/*=================================================================== - -The Medical Imaging Interaction Toolkit (MITK) - -Copyright (c) German Cancer Research Center, -Division of Medical and Biological Informatics. -All rights reserved. - -This software is distributed WITHOUT ANY WARRANTY; without -even the implied warranty of MERCHANTABILITY or FITNESS FOR -A PARTICULAR PURPOSE. - -See LICENSE.txt or http://www.mitk.org for details. - -===================================================================*/ - -#include "QmitkDiffusionImagingAppPerspective.h" -#include "berryIViewLayout.h" - -void QmitkDiffusionImagingAppPerspective::CreateInitialLayout(berry::IPageLayout::Pointer layout) -{ - ///////////////////////////////////////////////////// - // all di-app perspectives should have the following: - ///////////////////////////////////////////////////// - - std::string editorArea = layout->GetEditorArea(); - - layout->AddStandaloneView("org.mitk.views.datamanager", - false, berry::IPageLayout::LEFT, 0.3f, editorArea); - - layout->AddStandaloneView("org.mitk.views.controlvisualizationpropertiesview", - false, berry::IPageLayout::BOTTOM, .15f, "org.mitk.views.datamanager"); - - berry::IFolderLayout::Pointer left = - layout->CreateFolder("org.mbi.diffusionimaginginternal.leftcontrols", - berry::IPageLayout::BOTTOM, 0.1f, "org.mitk.views.controlvisualizationpropertiesview"); - - layout->AddStandaloneViewPlaceholder("org.mitk.views.imagenavigator", - berry::IPageLayout::BOTTOM, .4f, "org.mbi.diffusionimaginginternal.leftcontrols", false); - - ///////////////////////////////////////////// - // here goes the perspective specific stuff - ///////////////////////////////////////////// - - - - - -} diff --git a/Plugins/org.mitk.gui.qt.diffusionimagingapp/src/internal/Perspectives/QmitkGibbsTractographyPerspective.cpp b/Plugins/org.mitk.gui.qt.diffusionimagingapp/src/internal/Perspectives/QmitkGibbsTractographyPerspective.cpp deleted file mode 100644 index de5bb8dd42..0000000000 --- a/Plugins/org.mitk.gui.qt.diffusionimagingapp/src/internal/Perspectives/QmitkGibbsTractographyPerspective.cpp +++ /dev/null @@ -1,48 +0,0 @@ -/*=================================================================== - -The Medical Imaging Interaction Toolkit (MITK) - -Copyright (c) German Cancer Research Center, -Division of Medical and Biological Informatics. -All rights reserved. - -This software is distributed WITHOUT ANY WARRANTY; without -even the implied warranty of MERCHANTABILITY or FITNESS FOR -A PARTICULAR PURPOSE. - -See LICENSE.txt or http://www.mitk.org for details. - -===================================================================*/ - -#include "QmitkGibbsTractographyPerspective.h" -#include "berryIViewLayout.h" - -void QmitkGibbsTractographyPerspective::CreateInitialLayout(berry::IPageLayout::Pointer layout) -{ - ///////////////////////////////////////////////////// - // all di-app perspectives should have the following: - ///////////////////////////////////////////////////// - - std::string editorArea = layout->GetEditorArea(); - - layout->AddStandaloneView("org.mitk.views.datamanager", - false, berry::IPageLayout::LEFT, 0.3f, editorArea); - - layout->AddStandaloneView("org.mitk.views.controlvisualizationpropertiesview", - false, berry::IPageLayout::BOTTOM, .15f, "org.mitk.views.datamanager"); - - berry::IFolderLayout::Pointer left = - layout->CreateFolder("org.mbi.diffusionimaginginternal.leftcontrols", - berry::IPageLayout::BOTTOM, 0.1f, "org.mitk.views.controlvisualizationpropertiesview"); - - layout->AddStandaloneViewPlaceholder("org.mitk.views.imagenavigator", - berry::IPageLayout::BOTTOM, .4f, "org.mbi.diffusionimaginginternal.leftcontrols", false); - - ///////////////////////////////////////////// - // here goes the perspective specific stuff - ///////////////////////////////////////////// - - left->AddView("org.mitk.views.tensorreconstruction"); - left->AddView("org.mitk.views.qballreconstruction"); - left->AddView("org.mitk.views.gibbstracking"); -} diff --git a/Plugins/org.mitk.gui.qt.diffusionimagingapp/src/internal/Perspectives/QmitkProbabilisticTractographyPerspective.cpp b/Plugins/org.mitk.gui.qt.diffusionimagingapp/src/internal/Perspectives/QmitkProbabilisticTractographyPerspective.cpp deleted file mode 100644 index ff6ee899af..0000000000 --- a/Plugins/org.mitk.gui.qt.diffusionimagingapp/src/internal/Perspectives/QmitkProbabilisticTractographyPerspective.cpp +++ /dev/null @@ -1,48 +0,0 @@ -/*=================================================================== - -The Medical Imaging Interaction Toolkit (MITK) - -Copyright (c) German Cancer Research Center, -Division of Medical and Biological Informatics. -All rights reserved. - -This software is distributed WITHOUT ANY WARRANTY; without -even the implied warranty of MERCHANTABILITY or FITNESS FOR -A PARTICULAR PURPOSE. - -See LICENSE.txt or http://www.mitk.org for details. - -===================================================================*/ - -#include "QmitkProbabilisticTractographyPerspective.h" -#include "berryIViewLayout.h" - -void QmitkProbabilisticTractographyPerspective::CreateInitialLayout(berry::IPageLayout::Pointer layout) -{ - ///////////////////////////////////////////////////// - // all di-app perspectives should have the following: - ///////////////////////////////////////////////////// - - std::string editorArea = layout->GetEditorArea(); - - layout->AddStandaloneView("org.mitk.views.datamanager", - false, berry::IPageLayout::LEFT, 0.3f, editorArea); - - layout->AddStandaloneView("org.mitk.views.controlvisualizationpropertiesview", - false, berry::IPageLayout::BOTTOM, .15f, "org.mitk.views.datamanager"); - - berry::IFolderLayout::Pointer left = - layout->CreateFolder("org.mbi.diffusionimaginginternal.leftcontrols", - berry::IPageLayout::BOTTOM, 0.1f, "org.mitk.views.controlvisualizationpropertiesview"); - - layout->AddStandaloneViewPlaceholder("org.mitk.views.imagenavigator", - berry::IPageLayout::BOTTOM, .4f, "org.mbi.diffusionimaginginternal.leftcontrols", false); - - ///////////////////////////////////////////// - // here goes the perspective specific stuff - ///////////////////////////////////////////// - - left->AddView("org.mitk.views.diffusionpreprocessing"); - left->AddView("org.mitk.views.segmentation"); - left->AddView("org.mitk.views.stochasticfibertracking"); -} diff --git a/Plugins/org.mitk.gui.qt.diffusionimagingapp/src/internal/Perspectives/QmitkStreamlineTractographyPerspective.cpp b/Plugins/org.mitk.gui.qt.diffusionimagingapp/src/internal/Perspectives/QmitkStreamlineTractographyPerspective.cpp deleted file mode 100644 index 1223c6f931..0000000000 --- a/Plugins/org.mitk.gui.qt.diffusionimagingapp/src/internal/Perspectives/QmitkStreamlineTractographyPerspective.cpp +++ /dev/null @@ -1,48 +0,0 @@ -/*=================================================================== - -The Medical Imaging Interaction Toolkit (MITK) - -Copyright (c) German Cancer Research Center, -Division of Medical and Biological Informatics. -All rights reserved. - -This software is distributed WITHOUT ANY WARRANTY; without -even the implied warranty of MERCHANTABILITY or FITNESS FOR -A PARTICULAR PURPOSE. - -See LICENSE.txt or http://www.mitk.org for details. - -===================================================================*/ - -#include "QmitkStreamlineTractographyPerspective.h" -#include "berryIViewLayout.h" - -void QmitkStreamlineTractographyPerspective::CreateInitialLayout(berry::IPageLayout::Pointer layout) -{ - ///////////////////////////////////////////////////// - // all di-app perspectives should have the following: - ///////////////////////////////////////////////////// - - std::string editorArea = layout->GetEditorArea(); - - layout->AddStandaloneView("org.mitk.views.datamanager", - false, berry::IPageLayout::LEFT, 0.3f, editorArea); - - layout->AddStandaloneView("org.mitk.views.controlvisualizationpropertiesview", - false, berry::IPageLayout::BOTTOM, .15f, "org.mitk.views.datamanager"); - - berry::IFolderLayout::Pointer left = - layout->CreateFolder("org.mbi.diffusionimaginginternal.leftcontrols", - berry::IPageLayout::BOTTOM, 0.1f, "org.mitk.views.controlvisualizationpropertiesview"); - - layout->AddStandaloneViewPlaceholder("org.mitk.views.imagenavigator", - berry::IPageLayout::BOTTOM, .4f, "org.mbi.diffusionimaginginternal.leftcontrols", false); - - ///////////////////////////////////////////// - // here goes the perspective specific stuff - ///////////////////////////////////////////// - - left->AddView("org.mitk.views.tensorreconstruction"); - left->AddView("org.mitk.views.segmentation"); - left->AddView("org.mitk.views.streamlinetracking"); -} diff --git a/Plugins/org.mitk.gui.qt.diffusionimagingapp/src/internal/QmitkDiffusionApplicationPlugin.cpp b/Plugins/org.mitk.gui.qt.diffusionimagingapp/src/internal/QmitkDiffusionApplicationPlugin.cpp index d43779f683..d3dd44ef81 100644 --- a/Plugins/org.mitk.gui.qt.diffusionimagingapp/src/internal/QmitkDiffusionApplicationPlugin.cpp +++ b/Plugins/org.mitk.gui.qt.diffusionimagingapp/src/internal/QmitkDiffusionApplicationPlugin.cpp @@ -1,121 +1,88 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #include "QmitkDiffusionApplicationPlugin.h" #include "src/QmitkDiffusionImagingAppApplication.h" #include "src/internal/Perspectives/QmitkWelcomePerspective.h" #include "src/internal/QmitkDiffusionImagingAppIntroPart.h" -#include "src/internal/Perspectives/QmitkDiffusionImagingAppPerspective.h" - -#include "src/internal/Perspectives/QmitkDIAppConnectomicsPerspective.h" -#include "src/internal/Perspectives/QmitkDIAppDicomImportPerspective.h" -#include "src/internal/Perspectives/QmitkDIAppIVIMPerspective.h" -#include "src/internal/Perspectives/QmitkDIAppImageProcessingPerspective.h" -#include "src/internal/Perspectives/QmitkDIAppPreprocessingReconstructionPerspective.h" -#include "src/internal/Perspectives/QmitkDIAppQuantificationPerspective.h" -#include "src/internal/Perspectives/QmitkDIAppTBSSPerspective.h" -#include "src/internal/Perspectives/QmitkDIAppUtilityPerspective.h" -#include "src/internal/Perspectives/QmitkDIAppSyntheticDataGenerationPerspective.h" -#include "src/internal/Perspectives/QmitkDIAppRegistrationPerspective.h" -#include "src/internal/Perspectives/QmitkDIAppVisualizationPerspective.h" - -#include "src/internal/Perspectives/QmitkGibbsTractographyPerspective.h" -#include "src/internal/Perspectives/QmitkStreamlineTractographyPerspective.h" -#include "src/internal/Perspectives/QmitkProbabilisticTractographyPerspective.h" - #include #include #include #include #include #include #include QmitkDiffusionApplicationPlugin* QmitkDiffusionApplicationPlugin::inst = 0; QmitkDiffusionApplicationPlugin::QmitkDiffusionApplicationPlugin() { inst = this; } QmitkDiffusionApplicationPlugin::~QmitkDiffusionApplicationPlugin() { } QmitkDiffusionApplicationPlugin* QmitkDiffusionApplicationPlugin::GetDefault() { return inst; } void QmitkDiffusionApplicationPlugin::start(ctkPluginContext* context) { berry::AbstractUICTKPlugin::start(context); this->context = context; BERRY_REGISTER_EXTENSION_CLASS(QmitkDiffusionImagingAppApplication, context) BERRY_REGISTER_EXTENSION_CLASS(QmitkDiffusionImagingAppIntroPart, context) - BERRY_REGISTER_EXTENSION_CLASS(QmitkDiffusionImagingAppPerspective, context) BERRY_REGISTER_EXTENSION_CLASS(QmitkWelcomePerspective, context) - BERRY_REGISTER_EXTENSION_CLASS(QmitkDIAppConnectomicsPerspective, context) - BERRY_REGISTER_EXTENSION_CLASS(QmitkDIAppDicomImportPerspective, context) - BERRY_REGISTER_EXTENSION_CLASS(QmitkDIAppImageProcessingPerspective, context) - BERRY_REGISTER_EXTENSION_CLASS(QmitkDIAppIVIMPerspective, context) - BERRY_REGISTER_EXTENSION_CLASS(QmitkDIAppPreprocessingReconstructionPerspective, context) - BERRY_REGISTER_EXTENSION_CLASS(QmitkDIAppQuantificationPerspective, context) - BERRY_REGISTER_EXTENSION_CLASS(QmitkDIAppTBSSPerspective, context) - BERRY_REGISTER_EXTENSION_CLASS(QmitkDIAppUtilityPerspective, context) - BERRY_REGISTER_EXTENSION_CLASS(QmitkDIAppSyntheticDataGenerationPerspective, context) - BERRY_REGISTER_EXTENSION_CLASS(QmitkDIAppRegistrationPerspective, context) - BERRY_REGISTER_EXTENSION_CLASS(QmitkDIAppVisualizationPerspective, context) - - BERRY_REGISTER_EXTENSION_CLASS(QmitkGibbsTractographyPerspective, context) - BERRY_REGISTER_EXTENSION_CLASS(QmitkStreamlineTractographyPerspective, context) - BERRY_REGISTER_EXTENSION_CLASS(QmitkProbabilisticTractographyPerspective, context) + ctkServiceReference cmRef = context->getServiceReference(); ctkConfigurationAdmin* configAdmin = 0; if (cmRef) { configAdmin = context->getService(cmRef); } // Use the CTK Configuration Admin service to configure the BlueBerry help system if (configAdmin) { ctkConfigurationPtr conf = configAdmin->getConfiguration("org.blueberry.services.help", QString()); ctkDictionary helpProps; helpProps.insert("homePage", "qthelp://org.mitk.gui.qt.diffusionimagingapp/bundle/index.html"); conf->update(helpProps); context->ungetService(cmRef); } else { MITK_WARN << "Configuration Admin service unavailable, cannot set home page url."; } } ctkPluginContext* QmitkDiffusionApplicationPlugin::GetPluginContext() const { return context; } Q_EXPORT_PLUGIN2(org_mitk_gui_qt_diffusionimagingapp, QmitkDiffusionApplicationPlugin) diff --git a/Plugins/org.mitk.gui.qt.ext/files.cmake b/Plugins/org.mitk.gui.qt.ext/files.cmake index f4191da5d4..ba1181ca41 100644 --- a/Plugins/org.mitk.gui.qt.ext/files.cmake +++ b/Plugins/org.mitk.gui.qt.ext/files.cmake @@ -1,67 +1,58 @@ set(SRC_CPP_FILES QmitkExtActionBarAdvisor.cpp QmitkExtWorkbenchWindowAdvisor.cpp QmitkExtFileSaveProjectAction.cpp QmitkOpenDicomEditorAction.cpp QmitkOpenXnatEditorAction.cpp - - QmitkCandyStoreWidget.cpp - QmitkNewPerspectiveDialog.cpp ) set(INTERNAL_CPP_FILES QmitkAppInstancesPreferencePage.cpp QmitkExternalProgramsPreferencePage.cpp QmitkCommonExtPlugin.cpp QmitkInputDevicesPrefPage.cpp QmitkModuleView.cpp ) set(UI_FILES src/internal/QmitkAppInstancesPreferencePage.ui src/internal/QmitkExternalProgramsPreferencePage.ui - src/QmitkCandyStoreWidgetControls.ui ) set(MOC_H_FILES src/QmitkExtFileSaveProjectAction.h src/QmitkExtWorkbenchWindowAdvisor.h src/internal/QmitkAppInstancesPreferencePage.h src/internal/QmitkExternalProgramsPreferencePage.h src/internal/QmitkCommonExtPlugin.h src/internal/QmitkExtWorkbenchWindowAdvisorHack.h src/internal/QmitkInputDevicesPrefPage.h src/internal/QmitkModuleView.h src/QmitkOpenDicomEditorAction.h src/QmitkOpenXnatEditorAction.h - - src/QmitkCandyStoreWidget.h - src/mitkQtPerspectiveItem.h - src/mitkQtViewItem.h - src/QmitkNewPerspectiveDialog.h ) set(CACHED_RESOURCE_FILES # list of resource files which can be used by the plug-in # system without loading the plug-ins shared library, # for example the icon used in the menu and tabs for the # plug-in views in the workbench plugin.xml resources/ModuleView.png ) set(QRC_FILES # uncomment the following line if you want to use Qt resources resources/org_mitk_gui_qt_ext.qrc ) set(CPP_FILES ) foreach(file ${SRC_CPP_FILES}) set(CPP_FILES ${CPP_FILES} src/${file}) endforeach(file ${SRC_CPP_FILES}) foreach(file ${INTERNAL_CPP_FILES}) set(CPP_FILES ${CPP_FILES} src/internal/${file}) endforeach(file ${INTERNAL_CPP_FILES}) diff --git a/Plugins/org.mitk.gui.qt.ext/src/QmitkExtWorkbenchWindowAdvisor.cpp b/Plugins/org.mitk.gui.qt.ext/src/QmitkExtWorkbenchWindowAdvisor.cpp index 1945d37a05..6db9cb8e66 100644 --- a/Plugins/org.mitk.gui.qt.ext/src/QmitkExtWorkbenchWindowAdvisor.cpp +++ b/Plugins/org.mitk.gui.qt.ext/src/QmitkExtWorkbenchWindowAdvisor.cpp @@ -1,1264 +1,1322 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #include "QmitkExtWorkbenchWindowAdvisor.h" #include "QmitkExtActionBarAdvisor.h" #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include // UGLYYY #include "internal/QmitkExtWorkbenchWindowAdvisorHack.h" #include "internal/QmitkCommonExtPlugin.h" #include "mitkUndoController.h" #include "mitkVerboseLimitedLinearUndo.h" #include #include #include #include QmitkExtWorkbenchWindowAdvisorHack * QmitkExtWorkbenchWindowAdvisorHack::undohack = new QmitkExtWorkbenchWindowAdvisorHack(); QString QmitkExtWorkbenchWindowAdvisor::QT_SETTINGS_FILENAME = "QtSettings.ini"; class PartListenerForTitle: public berry::IPartListener { public: PartListenerForTitle(QmitkExtWorkbenchWindowAdvisor* wa) : windowAdvisor(wa) { } Events::Types GetPartEventTypes() const { return Events::ACTIVATED | Events::BROUGHT_TO_TOP | Events::CLOSED | Events::HIDDEN | Events::VISIBLE; } void PartActivated(berry::IWorkbenchPartReference::Pointer ref) { if (ref.Cast ()) { windowAdvisor->UpdateTitle(false); } } void PartBroughtToTop(berry::IWorkbenchPartReference::Pointer ref) { if (ref.Cast ()) { windowAdvisor->UpdateTitle(false); } } void PartClosed(berry::IWorkbenchPartReference::Pointer /*ref*/) { windowAdvisor->UpdateTitle(false); } void PartHidden(berry::IWorkbenchPartReference::Pointer ref) { if (!windowAdvisor->lastActiveEditor.Expired() && ref->GetPart(false) == windowAdvisor->lastActiveEditor.Lock()) { windowAdvisor->UpdateTitle(true); } } void PartVisible(berry::IWorkbenchPartReference::Pointer ref) { if (!windowAdvisor->lastActiveEditor.Expired() && ref->GetPart(false) == windowAdvisor->lastActiveEditor.Lock()) { windowAdvisor->UpdateTitle(false); } } private: QmitkExtWorkbenchWindowAdvisor* windowAdvisor; }; +class PartListenerForCandyStore: public berry::IPartListener +{ +public: + + PartListenerForCandyStore(QAction* act) : + candyStoreAction(act) + { + } + + Events::Types GetPartEventTypes() const + { + return Events::OPENED | Events::CLOSED | Events::HIDDEN | + Events::VISIBLE; + } + + void PartOpened(berry::IWorkbenchPartReference::Pointer ref) + { + if (ref->GetId()=="org.mitk.views.candystoreview") + { + candyStoreAction->setChecked(true); + } + } + + void PartClosed(berry::IWorkbenchPartReference::Pointer ref) + { + if (ref->GetId()=="org.mitk.views.candystoreview") + { + candyStoreAction->setChecked(false); + } + } + + void PartVisible(berry::IWorkbenchPartReference::Pointer ref) + { + if (ref->GetId()=="org.mitk.views.candystoreview") + { + candyStoreAction->setChecked(true); + } + } + + void PartHidden(berry::IWorkbenchPartReference::Pointer ref) + { + if (ref->GetId()=="org.mitk.views.candystoreview") + { + candyStoreAction->setChecked(false); + } + } + +private: + QAction* candyStoreAction; + +}; + class PartListenerForImageNavigator: public berry::IPartListener { public: PartListenerForImageNavigator(QAction* act) : imageNavigatorAction(act) { } Events::Types GetPartEventTypes() const { return Events::OPENED | Events::CLOSED | Events::HIDDEN | Events::VISIBLE; } void PartOpened(berry::IWorkbenchPartReference::Pointer ref) { if (ref->GetId()=="org.mitk.views.imagenavigator") { imageNavigatorAction->setChecked(true); } } void PartClosed(berry::IWorkbenchPartReference::Pointer ref) { if (ref->GetId()=="org.mitk.views.imagenavigator") { imageNavigatorAction->setChecked(false); } } void PartVisible(berry::IWorkbenchPartReference::Pointer ref) { if (ref->GetId()=="org.mitk.views.imagenavigator") { imageNavigatorAction->setChecked(true); } } void PartHidden(berry::IWorkbenchPartReference::Pointer ref) { if (ref->GetId()=="org.mitk.views.imagenavigator") { imageNavigatorAction->setChecked(false); } } private: QAction* imageNavigatorAction; }; class PerspectiveListenerForTitle: public berry::IPerspectiveListener { public: PerspectiveListenerForTitle(QmitkExtWorkbenchWindowAdvisor* wa) : windowAdvisor(wa), perspectivesClosed(false) { } Events::Types GetPerspectiveEventTypes() const { return Events::ACTIVATED | Events::SAVED_AS | Events::DEACTIVATED // remove the following line when command framework is finished | Events::CLOSED | Events::OPENED; } void PerspectiveActivated(berry::IWorkbenchPage::Pointer /*page*/, berry::IPerspectiveDescriptor::Pointer /*perspective*/) { windowAdvisor->UpdateTitle(false); } void PerspectiveSavedAs(berry::IWorkbenchPage::Pointer /*page*/, berry::IPerspectiveDescriptor::Pointer /*oldPerspective*/, berry::IPerspectiveDescriptor::Pointer /*newPerspective*/) { windowAdvisor->UpdateTitle(false); } void PerspectiveDeactivated(berry::IWorkbenchPage::Pointer /*page*/, berry::IPerspectiveDescriptor::Pointer /*perspective*/) { windowAdvisor->UpdateTitle(false); } void PerspectiveOpened(berry::IWorkbenchPage::Pointer /*page*/, berry::IPerspectiveDescriptor::Pointer /*perspective*/) { if (perspectivesClosed) { QListIterator i(windowAdvisor->viewActions); while (i.hasNext()) { i.next()->setEnabled(true); } //GetViewRegistry()->Find("org.mitk.views.imagenavigator"); if(windowAdvisor->GetWindowConfigurer()->GetWindow()->GetWorkbench()->GetEditorRegistry()->FindEditor("org.mitk.editors.dicomeditor")) { windowAdvisor->openDicomEditorAction->setEnabled(true); } if(windowAdvisor->GetWindowConfigurer()->GetWindow()->GetWorkbench()->GetEditorRegistry()->FindEditor("org.mitk.editors.xnat.browser")) { windowAdvisor->openXnatEditorAction->setEnabled(true); } windowAdvisor->fileSaveProjectAction->setEnabled(true); windowAdvisor->closeProjectAction->setEnabled(true); windowAdvisor->undoAction->setEnabled(true); windowAdvisor->redoAction->setEnabled(true); windowAdvisor->imageNavigatorAction->setEnabled(true); + windowAdvisor->candyStoreAction->setEnabled(true); windowAdvisor->resetPerspAction->setEnabled(true); if( windowAdvisor->GetShowClosePerspectiveMenuItem() ) { windowAdvisor->closePerspAction->setEnabled(true); } } perspectivesClosed = false; } void PerspectiveClosed(berry::IWorkbenchPage::Pointer /*page*/, berry::IPerspectiveDescriptor::Pointer /*perspective*/) { berry::IWorkbenchWindow::Pointer wnd = windowAdvisor->GetWindowConfigurer()->GetWindow(); bool allClosed = true; if (wnd->GetActivePage()) { std::vector perspectives(wnd->GetActivePage()->GetOpenPerspectives()); allClosed = perspectives.empty(); } if (allClosed) { perspectivesClosed = true; QListIterator i(windowAdvisor->viewActions); while (i.hasNext()) { i.next()->setEnabled(false); } if(windowAdvisor->GetWindowConfigurer()->GetWindow()->GetWorkbench()->GetEditorRegistry()->FindEditor("org.mitk.editors.dicomeditor")) { windowAdvisor->openDicomEditorAction->setEnabled(false); } if(windowAdvisor->GetWindowConfigurer()->GetWindow()->GetWorkbench()->GetEditorRegistry()->FindEditor("org.mitk.editors.xnat.browser")) { windowAdvisor->openXnatEditorAction->setEnabled(false); } windowAdvisor->fileSaveProjectAction->setEnabled(false); windowAdvisor->closeProjectAction->setEnabled(false); windowAdvisor->undoAction->setEnabled(false); windowAdvisor->redoAction->setEnabled(false); windowAdvisor->imageNavigatorAction->setEnabled(false); + windowAdvisor->candyStoreAction->setEnabled(false); windowAdvisor->resetPerspAction->setEnabled(false); if( windowAdvisor->GetShowClosePerspectiveMenuItem() ) { windowAdvisor->closePerspAction->setEnabled(false); } } } private: QmitkExtWorkbenchWindowAdvisor* windowAdvisor; bool perspectivesClosed; }; class PerspectiveListenerForMenu: public berry::IPerspectiveListener { public: PerspectiveListenerForMenu(QmitkExtWorkbenchWindowAdvisor* wa) : windowAdvisor(wa) { } Events::Types GetPerspectiveEventTypes() const { return Events::ACTIVATED | Events::DEACTIVATED; } void PerspectiveActivated(berry::IWorkbenchPage::Pointer /*page*/, berry::IPerspectiveDescriptor::Pointer perspective) { QAction* action = windowAdvisor->mapPerspIdToAction[perspective->GetId()]; if (action) { action->setChecked(true); } } void PerspectiveDeactivated(berry::IWorkbenchPage::Pointer /*page*/, berry::IPerspectiveDescriptor::Pointer perspective) { QAction* action = windowAdvisor->mapPerspIdToAction[perspective->GetId()]; if (action) { action->setChecked(false); } } private: QmitkExtWorkbenchWindowAdvisor* windowAdvisor; }; QmitkExtWorkbenchWindowAdvisor::QmitkExtWorkbenchWindowAdvisor(berry::WorkbenchAdvisor* wbAdvisor, berry::IWorkbenchWindowConfigurer::Pointer configurer) : berry::WorkbenchWindowAdvisor(configurer), lastInput(0), wbAdvisor(wbAdvisor), showViewToolbar(true), showPerspectiveToolbar(false), showVersionInfo(true), showMitkVersionInfo(true), showViewMenuItem(true), showNewWindowMenuItem(false), showClosePerspectiveMenuItem(true), - enableCandyStore(true), + candyStoreFound(false), showMemoryIndicator(true), dropTargetListener(new QmitkDefaultDropTargetListener) { productName = QCoreApplication::applicationName().toStdString(); + viewExcludeList.push_back("org.mitk.views.candystoreview"); } berry::ActionBarAdvisor::Pointer QmitkExtWorkbenchWindowAdvisor::CreateActionBarAdvisor( berry::IActionBarConfigurer::Pointer configurer) { berry::ActionBarAdvisor::Pointer actionBarAdvisor( new QmitkExtActionBarAdvisor(configurer)); return actionBarAdvisor; } void* QmitkExtWorkbenchWindowAdvisor::CreateEmptyWindowContents(void* parent) { QWidget* parentWidget = static_cast(parent); QLabel* label = new QLabel(parentWidget); label->setText("No perspectives are open. Open a perspective in the Window->Open Perspective menu."); label->setContentsMargins(10,10,10,10); label->setAlignment(Qt::AlignTop); label->setEnabled(false); parentWidget->layout()->addWidget(label); return label; } void QmitkExtWorkbenchWindowAdvisor::ShowClosePerspectiveMenuItem(bool show) { showClosePerspectiveMenuItem = show; } bool QmitkExtWorkbenchWindowAdvisor::GetShowClosePerspectiveMenuItem() { return showClosePerspectiveMenuItem; } void QmitkExtWorkbenchWindowAdvisor::ShowMemoryIndicator(bool show) { showMemoryIndicator = show; } bool QmitkExtWorkbenchWindowAdvisor::GetShowMemoryIndicator() { return showMemoryIndicator; } -void QmitkExtWorkbenchWindowAdvisor::EnableCandyStore(bool enable) -{ - enableCandyStore = enable; -} - -bool QmitkExtWorkbenchWindowAdvisor::GetEnableCandyStore() -{ - return enableCandyStore; -} - void QmitkExtWorkbenchWindowAdvisor::ShowNewWindowMenuItem(bool show) { showNewWindowMenuItem = show; } void QmitkExtWorkbenchWindowAdvisor::ShowViewToolbar(bool show) { showViewToolbar = show; } void QmitkExtWorkbenchWindowAdvisor::ShowViewMenuItem(bool show) { showViewMenuItem = show; } void QmitkExtWorkbenchWindowAdvisor::ShowPerspectiveToolbar(bool show) { showPerspectiveToolbar = show; } void QmitkExtWorkbenchWindowAdvisor::ShowVersionInfo(bool show) { showVersionInfo = show; } void QmitkExtWorkbenchWindowAdvisor::ShowMitkVersionInfo(bool show) { showMitkVersionInfo = show; } void QmitkExtWorkbenchWindowAdvisor::SetProductName(const std::string& product) { productName = product; } void QmitkExtWorkbenchWindowAdvisor::SetWindowIcon(const std::string& wndIcon) { windowIcon = wndIcon; } -void QmitkExtWorkbenchWindowAdvisor::onCandyStore() -{ - candyStore->setVisible(candyStoreAction->isChecked()); -} - void QmitkExtWorkbenchWindowAdvisor::PostWindowCreate() { // very bad hack... berry::IWorkbenchWindow::Pointer window = this->GetWindowConfigurer()->GetWindow(); QMainWindow* mainWindow = static_cast (window->GetShell()->GetControl()); window->SetPerspectiveExcludeList(perspectiveExcludeList); window->SetViewExcludeList(viewExcludeList); if (!windowIcon.empty()) { mainWindow->setWindowIcon(QIcon(QString::fromStdString(windowIcon))); } mainWindow->setContextMenuPolicy(Qt::PreventContextMenu); /*mainWindow->setStyleSheet("color: white;" "background-color: #808080;" "selection-color: #659EC7;" "selection-background-color: #808080;" " QMenuBar {" "background-color: #808080; }");*/ // ==== Application menu ============================ QMenuBar* menuBar = mainWindow->menuBar(); menuBar->setContextMenuPolicy(Qt::PreventContextMenu); QMenu* fileMenu = menuBar->addMenu("&File"); fileMenu->setObjectName("FileMenu"); QAction* fileOpenAction = new QmitkFileOpenAction(QIcon(":/org.mitk.gui.qt.ext/Load_48.png"), window); fileMenu->addAction(fileOpenAction); fileSaveProjectAction = new QmitkExtFileSaveProjectAction(window); fileSaveProjectAction->setIcon(QIcon(":/org.mitk.gui.qt.ext/Save_48.png")); fileMenu->addAction(fileSaveProjectAction); closeProjectAction = new QmitkCloseProjectAction(window); closeProjectAction->setIcon(QIcon(":/org.mitk.gui.qt.ext/Remove_48.png")); fileMenu->addAction(closeProjectAction); fileMenu->addSeparator(); QAction* fileExitAction = new QmitkFileExitAction(window); fileExitAction->setObjectName("QmitkFileExitAction"); fileMenu->addAction(fileExitAction); if(this->GetWindowConfigurer()->GetWindow()->GetWorkbench()->GetEditorRegistry()->FindEditor("org.mitk.editors.dicomeditor")) { openDicomEditorAction = new QmitkOpenDicomEditorAction(QIcon(":/org.mitk.gui.qt.ext/dcm-icon.png"),window); } if(this->GetWindowConfigurer()->GetWindow()->GetWorkbench()->GetEditorRegistry()->FindEditor("org.mitk.editors.xnat.browser")) { openXnatEditorAction = new QmitkOpenXnatEditorAction(QIcon(":/org.mitk.gui.qt.ext/xnat-icon.png"),window); } berry::IViewRegistry* viewRegistry = berry::PlatformUI::GetWorkbench()->GetViewRegistry(); const std::vector& viewDescriptors = viewRegistry->GetViews(); // another bad hack to get an edit/undo menu... QMenu* editMenu = menuBar->addMenu("&Edit"); undoAction = editMenu->addAction(QIcon(":/org.mitk.gui.qt.ext/Undo_48.png"), "&Undo", QmitkExtWorkbenchWindowAdvisorHack::undohack, SLOT(onUndo()), QKeySequence("CTRL+Z")); undoAction->setToolTip("Undo the last action (not supported by all modules)"); redoAction = editMenu->addAction(QIcon(":/org.mitk.gui.qt.ext/Redo_48.png") , "&Redo", QmitkExtWorkbenchWindowAdvisorHack::undohack, SLOT(onRedo()), QKeySequence("CTRL+Y")); redoAction->setToolTip("execute the last action that was undone again (not supported by all modules)"); imageNavigatorAction = new QAction(QIcon(":/org.mitk.gui.qt.ext/Slider.png"), "&Image Navigator", NULL); bool imageNavigatorViewFound = window->GetWorkbench()->GetViewRegistry()->Find("org.mitk.views.imagenavigator"); if (imageNavigatorViewFound) { QObject::connect(imageNavigatorAction, SIGNAL(triggered(bool)), QmitkExtWorkbenchWindowAdvisorHack::undohack, SLOT(onImageNavigator())); imageNavigatorAction->setCheckable(true); // add part listener for image navigator imageNavigatorPartListener = new PartListenerForImageNavigator(imageNavigatorAction); window->GetPartService()->AddPartListener(imageNavigatorPartListener); berry::IViewPart::Pointer imageNavigatorView = window->GetActivePage()->FindView("org.mitk.views.imagenavigator"); imageNavigatorAction->setChecked(false); if (imageNavigatorView) { bool isImageNavigatorVisible = window->GetActivePage()->IsPartVisible(imageNavigatorView); if (isImageNavigatorVisible) imageNavigatorAction->setChecked(true); } imageNavigatorAction->setToolTip("Toggle image navigator for navigating through image"); } + candyStoreAction = new QAction(QIcon(":/org.mitk.gui.qt.ext/Candy_icon.png"), "&Candy Store", NULL); + candyStoreFound = window->GetWorkbench()->GetViewRegistry()->Find("org.mitk.views.candystoreview"); + if (candyStoreFound) + { + QObject::connect(candyStoreAction, SIGNAL(triggered(bool)), QmitkExtWorkbenchWindowAdvisorHack::undohack, SLOT(onCandyStore())); + candyStoreAction->setCheckable(true); + + // add part listener for candy store + candyStorePartListener = new PartListenerForCandyStore(candyStoreAction); + window->GetPartService()->AddPartListener(candyStorePartListener); + berry::IViewPart::Pointer candystoreview = + window->GetActivePage()->FindView("org.mitk.views.candystoreview"); + candyStoreAction->setChecked(false); + if (candystoreview) + { + bool isCandyStoreVisible = window->GetActivePage()->IsPartVisible(candystoreview); + if (isCandyStoreVisible) + candyStoreAction->setChecked(true); + } + candyStoreAction->setToolTip("Toggle Candy Store"); + } + // toolbar for showing file open, undo, redo and other main actions QToolBar* mainActionsToolBar = new QToolBar; mainActionsToolBar->setObjectName("mainActionsToolBar"); mainActionsToolBar->setContextMenuPolicy(Qt::PreventContextMenu); #ifdef __APPLE__ mainActionsToolBar->setToolButtonStyle ( Qt::ToolButtonTextUnderIcon ); #else mainActionsToolBar->setToolButtonStyle ( Qt::ToolButtonTextBesideIcon ); #endif mainActionsToolBar->addAction(fileOpenAction); mainActionsToolBar->addAction(fileSaveProjectAction); mainActionsToolBar->addAction(closeProjectAction); mainActionsToolBar->addAction(undoAction); mainActionsToolBar->addAction(redoAction); if(this->GetWindowConfigurer()->GetWindow()->GetWorkbench()->GetEditorRegistry()->FindEditor("org.mitk.editors.dicomeditor")) { mainActionsToolBar->addAction(openDicomEditorAction); } if(this->GetWindowConfigurer()->GetWindow()->GetWorkbench()->GetEditorRegistry()->FindEditor("org.mitk.editors.xnat.browser")) { mainActionsToolBar->addAction(openXnatEditorAction); } if (imageNavigatorViewFound) { mainActionsToolBar->addAction(imageNavigatorAction); } - - if (enableCandyStore) - { - candyStoreAction = new QAction(QIcon(":/org.mitk.gui.qt.ext/Candy_icon.png"), "&Candy Store", NULL); - QObject::connect(candyStoreAction, SIGNAL(triggered(bool)), SLOT(onCandyStore())); - candyStoreAction->setCheckable(true); - candyStoreAction->setChecked(false); - candyStoreAction->setToolTip("Toggle Candy Store"); + if (candyStoreFound) mainActionsToolBar->addAction(candyStoreAction); - } + mainWindow->addToolBar(mainActionsToolBar); #ifdef __APPLE__ mainWindow->setUnifiedTitleAndToolBarOnMac(true); #endif // ==== Window Menu ========================== QMenu* windowMenu = menuBar->addMenu("Window"); if (showNewWindowMenuItem) { windowMenu->addAction("&New Window", QmitkExtWorkbenchWindowAdvisorHack::undohack, SLOT(onNewWindow())); windowMenu->addSeparator(); } QMenu* perspMenu = windowMenu->addMenu("&Open Perspective"); QMenu* viewMenu; if (showViewMenuItem) { viewMenu = windowMenu->addMenu("Show &View"); viewMenu->setObjectName("Show View"); } windowMenu->addSeparator(); resetPerspAction = windowMenu->addAction("&Reset Perspective", QmitkExtWorkbenchWindowAdvisorHack::undohack, SLOT(onResetPerspective())); if(showClosePerspectiveMenuItem) closePerspAction = windowMenu->addAction("&Close Perspective", QmitkExtWorkbenchWindowAdvisorHack::undohack, SLOT(onClosePerspective())); windowMenu->addSeparator(); windowMenu->addAction("&Preferences...", QmitkExtWorkbenchWindowAdvisorHack::undohack, SLOT(onEditPreferences()), QKeySequence("CTRL+P")); // fill perspective menu berry::IPerspectiveRegistry* perspRegistry = window->GetWorkbench()->GetPerspectiveRegistry(); QActionGroup* perspGroup = new QActionGroup(menuBar); std::vector perspectives( perspRegistry->GetPerspectives()); bool skip = false; for (std::vector::iterator perspIt = perspectives.begin(); perspIt != perspectives.end(); ++perspIt) { // if perspectiveExcludeList is set, it contains the id-strings of perspectives, which // should not appear as an menu-entry in the perspective menu if (perspectiveExcludeList.size() > 0) { for (unsigned int i=0; iGetId()) { skip = true; break; } } if (skip) { skip = false; continue; } } QAction* perspAction = new berry::QtOpenPerspectiveAction(window, *perspIt, perspGroup); mapPerspIdToAction.insert(std::make_pair((*perspIt)->GetId(), perspAction)); } perspMenu->addActions(perspGroup->actions()); // sort elements (converting vector to map...) std::vector::const_iterator iter; std::map VDMap; skip = false; for (iter = viewDescriptors.begin(); iter != viewDescriptors.end(); ++iter) { // if viewExcludeList is set, it contains the id-strings of view, which // should not appear as an menu-entry in the menu if (viewExcludeList.size() > 0) { for (unsigned int i=0; iGetId()) { skip = true; break; } } if (skip) { skip = false; continue; } } if ((*iter)->GetId() == "org.blueberry.ui.internal.introview") continue; if ((*iter)->GetId() == "org.mitk.views.imagenavigator") continue; + if ((*iter)->GetId() == "org.mitk.views.candystoreview") + continue; std::pair p( (*iter)->GetLabel(), (*iter)); VDMap.insert(p); } - // ================================================== // ==== Perspective Toolbar ================================== QToolBar* qPerspectiveToolbar = new QToolBar; qPerspectiveToolbar->setObjectName("perspectiveToolBar"); if (showPerspectiveToolbar) { qPerspectiveToolbar->addActions(perspGroup->actions()); mainWindow->addToolBar(qPerspectiveToolbar); } else delete qPerspectiveToolbar; // ==== View Toolbar ================================== QToolBar* qToolbar = new QToolBar; qToolbar->setObjectName("viewToolBar"); std::map::const_iterator MapIter; for (MapIter = VDMap.begin(); MapIter != VDMap.end(); ++MapIter) { berry::QtShowViewAction* viewAction = new berry::QtShowViewAction(window, (*MapIter).second); viewActions.push_back(viewAction); if(showViewMenuItem) viewMenu->addAction(viewAction); if (showViewToolbar) { qToolbar->addAction(viewAction); } } if (showViewToolbar) { mainWindow->addToolBar(qToolbar); } else delete qToolbar; QSettings settings(GetQSettingsFile(), QSettings::IniFormat); mainWindow->restoreState(settings.value("ToolbarPosition").toByteArray()); - - // ==================================================== - // ===== Help menu ==================================== QMenu* helpMenu = menuBar->addMenu("&Help"); helpMenu->addAction("&Welcome",this, SLOT(onIntro())); helpMenu->addAction("&Open Help Perspective", this, SLOT(onHelpOpenHelpPerspective())); helpMenu->addAction("&Context Help",this, SLOT(onHelp()), QKeySequence("F1")); helpMenu->addAction("&About",this, SLOT(onAbout())); // ===================================================== - QStatusBar* qStatusBar = new QStatusBar(); //creating a QmitkStatusBar for Output on the QStatusBar and connecting it with the MainStatusBar QmitkStatusBar *statusBar = new QmitkStatusBar(qStatusBar); //disabling the SizeGrip in the lower right corner statusBar->SetSizeGripEnabled(false); - - QmitkProgressBar *progBar = new QmitkProgressBar(); qStatusBar->addPermanentWidget(progBar, 0); progBar->hide(); // progBar->AddStepsToDo(2); // progBar->Progress(1); mainWindow->setStatusBar(qStatusBar); -// QLabel* label = new QLabel(); -// label->setText(" Candy Store"); - candyStore = new QDockWidget("Candy Store"); - candyStore->setWidget(new QmitkCandyStoreWidget()); - candyStore->setFeatures(QDockWidget::DockWidgetMovable | QDockWidget::DockWidgetFloatable); - candyStore->setVisible(false); - candyStore->setObjectName("Candy Store"); -// candyStore->setTitleBarWidget(label); - mainWindow->addDockWidget(Qt::LeftDockWidgetArea, candyStore); - if (showMemoryIndicator) { QmitkMemoryUsageIndicatorView* memoryIndicator = new QmitkMemoryUsageIndicatorView(); qStatusBar->addPermanentWidget(memoryIndicator, 0); } } void QmitkExtWorkbenchWindowAdvisor::PreWindowOpen() { berry::IWorkbenchWindowConfigurer::Pointer configurer = GetWindowConfigurer(); // show the shortcut bar and progress indicator, which are hidden by // default //configurer->SetShowPerspectiveBar(true); //configurer->SetShowFastViewBars(true); //configurer->SetShowProgressIndicator(true); // // add the drag and drop support for the editor area // configurer.addEditorAreaTransfer(EditorInputTransfer.getInstance()); // configurer.addEditorAreaTransfer(ResourceTransfer.getInstance()); // configurer.addEditorAreaTransfer(FileTransfer.getInstance()); // configurer.addEditorAreaTransfer(MarkerTransfer.getInstance()); // configurer.configureEditorAreaDropListener(new EditorAreaDropAdapter( // configurer.getWindow())); this->HookTitleUpdateListeners(configurer); menuPerspectiveListener = new PerspectiveListenerForMenu(this); configurer->GetWindow()->AddPerspectiveListener(menuPerspectiveListener); configurer->AddEditorAreaTransfer(QStringList("text/uri-list")); configurer->ConfigureEditorAreaDropListener(dropTargetListener); } void QmitkExtWorkbenchWindowAdvisor::PostWindowOpen() { // Force Rendering Window Creation on startup. berry::IWorkbenchWindowConfigurer::Pointer configurer = GetWindowConfigurer(); ctkPluginContext* context = QmitkCommonExtPlugin::getContext(); ctkServiceReference serviceRef = context->getServiceReference(); if (serviceRef) { mitk::IDataStorageService *dsService = context->getService(serviceRef); if (dsService) { mitk::IDataStorageReference::Pointer dsRef = dsService->GetDataStorage(); mitk::DataStorageEditorInput::Pointer dsInput(new mitk::DataStorageEditorInput(dsRef)); mitk::WorkbenchUtil::OpenEditor(configurer->GetWindow()->GetActivePage(),dsInput); } } } void QmitkExtWorkbenchWindowAdvisor::onIntro() { QmitkExtWorkbenchWindowAdvisorHack::undohack->onIntro(); } void QmitkExtWorkbenchWindowAdvisor::onHelp() { QmitkExtWorkbenchWindowAdvisorHack::undohack->onHelp(); } void QmitkExtWorkbenchWindowAdvisor::onHelpOpenHelpPerspective() { QmitkExtWorkbenchWindowAdvisorHack::undohack->onHelpOpenHelpPerspective(); } void QmitkExtWorkbenchWindowAdvisor::onAbout() { QmitkExtWorkbenchWindowAdvisorHack::undohack->onAbout(); } //-------------------------------------------------------------------------------- // Ugly hack from here on. Feel free to delete when command framework // and undo buttons are done. //-------------------------------------------------------------------------------- QmitkExtWorkbenchWindowAdvisorHack::QmitkExtWorkbenchWindowAdvisorHack() : QObject() { } QmitkExtWorkbenchWindowAdvisorHack::~QmitkExtWorkbenchWindowAdvisorHack() { } void QmitkExtWorkbenchWindowAdvisorHack::onUndo() { mitk::UndoModel* model = mitk::UndoController::GetCurrentUndoModel(); if (model) { if (mitk::VerboseLimitedLinearUndo* verboseundo = dynamic_cast( model )) { mitk::VerboseLimitedLinearUndo::StackDescription descriptions = verboseundo->GetUndoDescriptions(); if (descriptions.size() >= 1) { MITK_INFO << "Undo " << descriptions.front().second; } } model->Undo(); } else { MITK_ERROR << "No undo model instantiated"; } } void QmitkExtWorkbenchWindowAdvisorHack::onRedo() { mitk::UndoModel* model = mitk::UndoController::GetCurrentUndoModel(); if (model) { if (mitk::VerboseLimitedLinearUndo* verboseundo = dynamic_cast( model )) { mitk::VerboseLimitedLinearUndo::StackDescription descriptions = verboseundo->GetRedoDescriptions(); if (descriptions.size() >= 1) { MITK_INFO << "Redo " << descriptions.front().second; } } model->Redo(); } else { MITK_ERROR << "No undo model instantiated"; } } void QmitkExtWorkbenchWindowAdvisorHack::onImageNavigator() { // get ImageNavigatorView berry::IViewPart::Pointer imageNavigatorView = berry::PlatformUI::GetWorkbench()->GetActiveWorkbenchWindow()->GetActivePage()->FindView("org.mitk.views.imagenavigator"); if (imageNavigatorView) { bool isImageNavigatorVisible = berry::PlatformUI::GetWorkbench()->GetActiveWorkbenchWindow()->GetActivePage()->IsPartVisible(imageNavigatorView); if (isImageNavigatorVisible) { berry::PlatformUI::GetWorkbench()->GetActiveWorkbenchWindow()->GetActivePage()->HideView(imageNavigatorView); return; } } berry::PlatformUI::GetWorkbench()->GetActiveWorkbenchWindow()->GetActivePage()->ShowView("org.mitk.views.imagenavigator"); //berry::PlatformUI::GetWorkbench()->GetActiveWorkbenchWindow()->GetActivePage()->ResetPerspective(); } +void QmitkExtWorkbenchWindowAdvisorHack::onCandyStore() +{ + // get candystoreView + berry::IViewPart::Pointer candystoreView = + berry::PlatformUI::GetWorkbench()->GetActiveWorkbenchWindow()->GetActivePage()->FindView("org.mitk.views.candystoreview"); + if (candystoreView) + { + bool iscandystoreVisible = berry::PlatformUI::GetWorkbench()->GetActiveWorkbenchWindow()->GetActivePage()->IsPartVisible(candystoreView); + if (iscandystoreVisible) + { + berry::PlatformUI::GetWorkbench()->GetActiveWorkbenchWindow()->GetActivePage()->HideView(candystoreView); + return; + } + } + berry::PlatformUI::GetWorkbench()->GetActiveWorkbenchWindow()->GetActivePage()->ShowView("org.mitk.views.candystoreview"); + //berry::PlatformUI::GetWorkbench()->GetActiveWorkbenchWindow()->GetActivePage()->ResetPerspective(); +} + void QmitkExtWorkbenchWindowAdvisorHack::onEditPreferences() { QmitkPreferencesDialog _PreferencesDialog(QApplication::activeWindow()); _PreferencesDialog.exec(); } void QmitkExtWorkbenchWindowAdvisorHack::onQuit() { berry::PlatformUI::GetWorkbench()->Close(); } void QmitkExtWorkbenchWindowAdvisorHack::onResetPerspective() { berry::PlatformUI::GetWorkbench()->GetActiveWorkbenchWindow()->GetActivePage()->ResetPerspective(); } void QmitkExtWorkbenchWindowAdvisorHack::onClosePerspective() { berry::IWorkbenchPage::Pointer page = berry::PlatformUI::GetWorkbench()->GetActiveWorkbenchWindow()->GetActivePage(); page->ClosePerspective(page->GetPerspective(), true, true); } void QmitkExtWorkbenchWindowAdvisorHack::onNewWindow() { berry::PlatformUI::GetWorkbench()->OpenWorkbenchWindow(0); } void QmitkExtWorkbenchWindowAdvisorHack::onIntro() { bool hasIntro = berry::PlatformUI::GetWorkbench()->GetIntroManager()->HasIntro(); if (!hasIntro) { QRegExp reg("(.*)(\\n)*"); QRegExp reg2("(\\n)*(.*)"); QFile file(":/org.mitk.gui.qt.ext/index.html"); file.open(QIODevice::ReadOnly | QIODevice::Text); //text file only for reading QString text = QString(file.readAll()); file.close(); QString title = text; title.replace(reg, ""); title.replace(reg2, ""); std::cout << title.toStdString() << std::endl; QMessageBox::information(NULL, title, text, "Close"); } else { berry::PlatformUI::GetWorkbench()->GetIntroManager()->ShowIntro( berry::PlatformUI::GetWorkbench()->GetActiveWorkbenchWindow(), false); } } void QmitkExtWorkbenchWindowAdvisorHack::onHelp() { ctkPluginContext* context = QmitkCommonExtPlugin::getContext(); if (context == 0) { MITK_WARN << "Plugin context not set, unable to open context help"; return; } // Check if the org.blueberry.ui.qt.help plug-in is installed and started QList > plugins = context->getPlugins(); foreach(QSharedPointer p, plugins) { if (p->getSymbolicName() == "org.blueberry.ui.qt.help") { if (p->getState() != ctkPlugin::ACTIVE) { // try to activate the plug-in explicitly try { p->start(ctkPlugin::START_TRANSIENT); } catch (const ctkPluginException& pe) { MITK_ERROR << "Activating org.blueberry.ui.qt.help failed: " << pe.what(); return; } } } } ctkServiceReference eventAdminRef = context->getServiceReference(); ctkEventAdmin* eventAdmin = 0; if (eventAdminRef) { eventAdmin = context->getService(eventAdminRef); } if (eventAdmin == 0) { MITK_WARN << "ctkEventAdmin service not found. Unable to open context help"; } else { ctkEvent ev("org/blueberry/ui/help/CONTEXTHELP_REQUESTED"); eventAdmin->postEvent(ev); } } void QmitkExtWorkbenchWindowAdvisorHack::onHelpOpenHelpPerspective() { berry::PlatformUI::GetWorkbench()->ShowPerspective("org.blueberry.perspectives.help", berry::PlatformUI::GetWorkbench()->GetActiveWorkbenchWindow()); } void QmitkExtWorkbenchWindowAdvisorHack::onAbout() { QmitkAboutDialog* aboutDialog = new QmitkAboutDialog(QApplication::activeWindow(),NULL); aboutDialog->open(); } void QmitkExtWorkbenchWindowAdvisor::HookTitleUpdateListeners( berry::IWorkbenchWindowConfigurer::Pointer configurer) { // hook up the listeners to update the window title titlePartListener = new PartListenerForTitle(this); titlePerspectiveListener = new PerspectiveListenerForTitle(this); editorPropertyListener = new berry::PropertyChangeIntAdapter< QmitkExtWorkbenchWindowAdvisor>(this, &QmitkExtWorkbenchWindowAdvisor::PropertyChange); // configurer.getWindow().addPageListener(new IPageListener() { // public void pageActivated(IWorkbenchPage page) { // updateTitle(false); // } // // public void pageClosed(IWorkbenchPage page) { // updateTitle(false); // } // // public void pageOpened(IWorkbenchPage page) { // // do nothing // } // }); configurer->GetWindow()->AddPerspectiveListener(titlePerspectiveListener); configurer->GetWindow()->GetPartService()->AddPartListener(titlePartListener); } std::string QmitkExtWorkbenchWindowAdvisor::ComputeTitle() { berry::IWorkbenchWindowConfigurer::Pointer configurer = GetWindowConfigurer(); berry::IWorkbenchPage::Pointer currentPage = configurer->GetWindow()->GetActivePage(); berry::IEditorPart::Pointer activeEditor; if (currentPage) { activeEditor = lastActiveEditor.Lock(); } std::string title; //TODO Product // IProduct product = Platform.getProduct(); // if (product != null) { // title = product.getName(); // } // instead of the product name, we use a custom variable for now title = productName; if(showMitkVersionInfo) { title += std::string(" ") + MITK_VERSION_STRING; } if (showVersionInfo) { // add version informatioin QString versions = QString(" (ITK %1.%2.%3 VTK %4.%5.%6 Qt %7 MITK %8)") .arg(ITK_VERSION_MAJOR).arg(ITK_VERSION_MINOR).arg(ITK_VERSION_PATCH) .arg(VTK_MAJOR_VERSION).arg(VTK_MINOR_VERSION).arg(VTK_BUILD_VERSION) .arg(QT_VERSION_STR) .arg(MITK_VERSION_STRING); title += versions.toStdString(); } if (currentPage) { if (activeEditor) { lastEditorTitle = activeEditor->GetTitleToolTip(); if (!lastEditorTitle.empty()) title = lastEditorTitle + " - " + title; } berry::IPerspectiveDescriptor::Pointer persp = currentPage->GetPerspective(); std::string label = ""; if (persp) { label = persp->GetLabel(); } berry::IAdaptable* input = currentPage->GetInput(); if (input && input != wbAdvisor->GetDefaultPageInput()) { label = currentPage->GetLabel(); } if (!label.empty()) { title = label + " - " + title; } } title += " (Not for use in diagnosis or treatment of patients)"; return title; } void QmitkExtWorkbenchWindowAdvisor::RecomputeTitle() { berry::IWorkbenchWindowConfigurer::Pointer configurer = GetWindowConfigurer(); std::string oldTitle = configurer->GetTitle(); std::string newTitle = ComputeTitle(); if (newTitle != oldTitle) { configurer->SetTitle(newTitle); } } void QmitkExtWorkbenchWindowAdvisor::UpdateTitle(bool editorHidden) { berry::IWorkbenchWindowConfigurer::Pointer configurer = GetWindowConfigurer(); berry::IWorkbenchWindow::Pointer window = configurer->GetWindow(); berry::IEditorPart::Pointer activeEditor; berry::IWorkbenchPage::Pointer currentPage = window->GetActivePage(); berry::IPerspectiveDescriptor::Pointer persp; berry::IAdaptable* input = 0; if (currentPage) { activeEditor = currentPage->GetActiveEditor(); persp = currentPage->GetPerspective(); input = currentPage->GetInput(); } if (editorHidden) { activeEditor = 0; } // Nothing to do if the editor hasn't changed if (activeEditor == lastActiveEditor.Lock() && currentPage == lastActivePage.Lock() && persp == lastPerspective.Lock() && input == lastInput) { return; } if (!lastActiveEditor.Expired()) { lastActiveEditor.Lock()->RemovePropertyListener(editorPropertyListener); } lastActiveEditor = activeEditor; lastActivePage = currentPage; lastPerspective = persp; lastInput = input; if (activeEditor) { activeEditor->AddPropertyListener(editorPropertyListener); } RecomputeTitle(); } void QmitkExtWorkbenchWindowAdvisor::PropertyChange(berry::Object::Pointer /*source*/, int propId) { if (propId == berry::IWorkbenchPartConstants::PROP_TITLE) { if (!lastActiveEditor.Expired()) { std::string newTitle = lastActiveEditor.Lock()->GetPartName(); if (lastEditorTitle != newTitle) { RecomputeTitle(); } } } } void QmitkExtWorkbenchWindowAdvisor::SetPerspectiveExcludeList(std::vector v) { this->perspectiveExcludeList = v; } std::vector QmitkExtWorkbenchWindowAdvisor::GetPerspectiveExcludeList() { return this->perspectiveExcludeList; } void QmitkExtWorkbenchWindowAdvisor::SetViewExcludeList(std::vector v) { this->viewExcludeList = v; } std::vector QmitkExtWorkbenchWindowAdvisor::GetViewExcludeList() { return this->viewExcludeList; } void QmitkExtWorkbenchWindowAdvisor::PostWindowClose() { berry::IWorkbenchWindow::Pointer window = this->GetWindowConfigurer()->GetWindow(); QMainWindow* mainWindow = static_cast (window->GetShell()->GetControl()); QSettings settings(GetQSettingsFile(), QSettings::IniFormat); settings.setValue("ToolbarPosition", mainWindow->saveState()); } QString QmitkExtWorkbenchWindowAdvisor::GetQSettingsFile() const { QFileInfo settingsInfo = QmitkCommonExtPlugin::getContext()->getDataFile(QT_SETTINGS_FILENAME); return settingsInfo.canonicalFilePath(); } diff --git a/Plugins/org.mitk.gui.qt.ext/src/QmitkExtWorkbenchWindowAdvisor.h b/Plugins/org.mitk.gui.qt.ext/src/QmitkExtWorkbenchWindowAdvisor.h index f79da801a3..a85e8c04dd 100644 --- a/Plugins/org.mitk.gui.qt.ext/src/QmitkExtWorkbenchWindowAdvisor.h +++ b/Plugins/org.mitk.gui.qt.ext/src/QmitkExtWorkbenchWindowAdvisor.h @@ -1,185 +1,178 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QMITKEXTWORKBENCHWINDOWADVISOR_H_ #define QMITKEXTWORKBENCHWINDOWADVISOR_H_ #include #include #include #include #include #include #include #include -#include -#include class QAction; class QMenu; class MITK_QT_COMMON_EXT_EXPORT QmitkExtWorkbenchWindowAdvisor : public QObject, public berry::WorkbenchWindowAdvisor { Q_OBJECT public: QmitkExtWorkbenchWindowAdvisor(berry::WorkbenchAdvisor* wbAdvisor, berry::IWorkbenchWindowConfigurer::Pointer configurer); berry::ActionBarAdvisor::Pointer CreateActionBarAdvisor( berry::IActionBarConfigurer::Pointer configurer); void* CreateEmptyWindowContents(void* parent); void PostWindowCreate(); void PreWindowOpen(); void PostWindowOpen(); void PostWindowClose(); void ShowViewToolbar(bool show); void ShowPerspectiveToolbar(bool show); void ShowVersionInfo(bool show); void ShowMitkVersionInfo(bool show); void ShowViewMenuItem(bool show); void ShowNewWindowMenuItem(bool show); void ShowClosePerspectiveMenuItem(bool show); bool GetShowClosePerspectiveMenuItem(); - void EnableCandyStore(bool enable); - - bool GetEnableCandyStore(); - void ShowMemoryIndicator(bool show); bool GetShowMemoryIndicator(); //TODO should be removed when product support is here void SetProductName(const std::string& product); void SetWindowIcon(const std::string& wndIcon); void SetPerspectiveExcludeList(std::vector v); std::vector GetPerspectiveExcludeList(); void SetViewExcludeList(std::vector v); std::vector GetViewExcludeList(); protected slots: virtual void onIntro(); virtual void onHelp(); virtual void onHelpOpenHelpPerspective(); virtual void onAbout(); - void onCandyStore(); private: /** * Hooks the listeners needed on the window * * @param configurer */ void HookTitleUpdateListeners(berry::IWorkbenchWindowConfigurer::Pointer configurer); std::string ComputeTitle(); void RecomputeTitle(); QString GetQSettingsFile() const; /** * Updates the window title. Format will be: [pageInput -] * [currentPerspective -] [editorInput -] [workspaceLocation -] productName * @param editorHidden TODO */ void UpdateTitle(bool editorHidden); void PropertyChange(berry::Object::Pointer /*source*/, int propId); static QString QT_SETTINGS_FILENAME; berry::IPartListener::Pointer titlePartListener; berry::IPerspectiveListener::Pointer titlePerspectiveListener; berry::IPerspectiveListener::Pointer menuPerspectiveListener; berry::IPartListener::Pointer imageNavigatorPartListener; - berry::IPartListener::Pointer CandyStorePartListener; + berry::IPartListener::Pointer candyStorePartListener; berry::IPropertyChangeListener::Pointer editorPropertyListener; friend struct berry::PropertyChangeIntAdapter; friend class PartListenerForTitle; friend class PerspectiveListenerForTitle; friend class PerspectiveListenerForMenu; friend class PartListenerForImageNavigator; + friend class PartListenerForCandyStore; berry::IEditorPart::WeakPtr lastActiveEditor; berry::IPerspectiveDescriptor::WeakPtr lastPerspective; berry::IWorkbenchPage::WeakPtr lastActivePage; std::string lastEditorTitle; berry::IAdaptable* lastInput; berry::WorkbenchAdvisor* wbAdvisor; bool showViewToolbar; bool showPerspectiveToolbar; bool showVersionInfo; bool showMitkVersionInfo; bool showViewMenuItem; bool showNewWindowMenuItem; bool showClosePerspectiveMenuItem; - bool enableCandyStore; + bool candyStoreFound; bool showMemoryIndicator; std::string productName; std::string windowIcon; // enables DnD on the editor area berry::IDropTargetListener::Pointer dropTargetListener; // stringlist for excluding perspectives from the perspective menu entry (e.g. Welcome Perspective) std::vector perspectiveExcludeList; // stringlist for excluding views from the menu entry std::vector viewExcludeList; // maps perspective ids to QAction objects std::map mapPerspIdToAction; // actions which will be enabled/disabled depending on the application state QList viewActions; QAction* fileSaveProjectAction; QAction* closeProjectAction; QAction* undoAction; QAction* redoAction; QAction* imageNavigatorAction; QAction* candyStoreAction; QAction* resetPerspAction; QAction* closePerspAction; QAction* openDicomEditorAction; QAction* openXnatEditorAction; - QDockWidget* candyStore; }; #endif /*QMITKEXTWORKBENCHWINDOWADVISOR_H_*/ diff --git a/Plugins/org.mitk.gui.qt.ext/src/internal/QmitkExtWorkbenchWindowAdvisorHack.h b/Plugins/org.mitk.gui.qt.ext/src/internal/QmitkExtWorkbenchWindowAdvisorHack.h index 96f8edb1d1..a994eb806f 100644 --- a/Plugins/org.mitk.gui.qt.ext/src/internal/QmitkExtWorkbenchWindowAdvisorHack.h +++ b/Plugins/org.mitk.gui.qt.ext/src/internal/QmitkExtWorkbenchWindowAdvisorHack.h @@ -1,58 +1,59 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #include class ctkPluginContext; class QmitkPreferencesDialog; class QmitkExtWorkbenchWindowAdvisorHack : public QObject { Q_OBJECT public slots: void onUndo(); void onRedo(); void onImageNavigator(); + void onCandyStore(); void onEditPreferences(); void onQuit(); void onResetPerspective(); void onClosePerspective(); void onNewWindow(); void onIntro(); /** * @brief This slot is called if the user klicks the menu item "help->context help" or presses F1. * The help page is shown in a workbench editor. */ void onHelp(); void onHelpOpenHelpPerspective(); /** * @brief This slot is called if the user clicks in help menu the about button */ void onAbout(); public: QmitkExtWorkbenchWindowAdvisorHack(); ~QmitkExtWorkbenchWindowAdvisorHack(); static QmitkExtWorkbenchWindowAdvisorHack* undohack; };