<extension implements="::fwServices::registry::AppConfig">
    <id>3DVisualization</id>
    <type>parameters</type>
    <parameters>
        <param name="WID_PARENT" />
        <param name="GENERIC_UID" />
        <param name="ICON_PATH" />
        <param name="SERIESDB" />
        <param name="AS_UID" />
        <param name="modelSeriesUid" />
        <param name="InputImageCompositeUID" />
        <param name="patient_name"  default="" />
    </parameters>
    <config>

        <object type="::fwData::Composite">

            <service uid="${GENERIC_UID}_mainView" type="::gui::view::IView" impl="::gui::view::DefaultView" autoConnect="no">
                <gui>
                    <layout type="::fwGui::CardinalLayoutManager">
                        <view caption="Negato1" align="center" />
                        <view caption="Negato2" align="right" minWidth="350" visible="no" />
                        <view caption="Negato3" align="right" minWidth="350" visible="no" />
                    </layout>
                    <toolBar />
                </gui>
                <registry>
                    <parent wid="${WID_PARENT}" />
                    <toolBar sid="${GENERIC_UID}_toolBar" start="yes" />
                    <view wid="${GENERIC_UID}_view_negato1" />
                    <view wid="${GENERIC_UID}_view_negato2" />
                    <view wid="${GENERIC_UID}_view_negato3" />
                </registry>
            </service>

            <service uid="${GENERIC_UID}_toolBar" type="::fwGui::IToolBarSrv" impl="::gui::aspect::DefaultToolBarSrv" autoConnect="no">
                <gui>
                    <layout>
                        <menuItem name="3D MPR Axial view" icon="Bundles/media_0-1/icons/icon-axial.png" />
                        <menuItem name="3D MPR Frontal view" icon="Bundles/media_0-1/icons/icon-frontal.png" />
                        <menuItem name="3D MPR Sagittal view" icon="Bundles/media_0-1/icons/icon-sagittal.png" />
                        <separator />
                        <menuItem name="New landmark" icon="Bundles/media_0-1/icons/Add-landmark.png" />
                        <menuItem name="Remove landmark" icon="Bundles/media_0-1/icons/Remove-landmark.png" />
                        <menuItem name="Load landmark" icon="Bundles/media_0-1/icons/Load-landmark.png" />
                        <menuItem name="Save landmark" icon="Bundles/media_0-1/icons/Save-landmark.png" />
                        <menuItem name="Focus landmark" icon="Bundles/media_0-1/icons/Find-landmark.png" />
                        <menuItem name="Hide/Show landmark" icon="Bundles/media_0-1/icons/View-landmark.png" />
                        <separator />
                        <menuItem name="Add distance" icon="Bundles/media_0-1/icons/distance.png" />
                        <menuItem name="Remove distance" icon="Bundles/media_0-1/icons/RemoveDistance.png" />
                        <menuItem name="Hide distance" icon="Bundles/media_0-1/icons/HideDistance.png" style="check" />
                        <separator />
                        <menuItem name="Hide cross" icon="Bundles/media_0-1/icons/HideCross.png" style="radio" />
                        <menuItem name="Show normal cross" icon="Bundles/media_0-1/icons/NormalCross.png" style="radio" />
                        <menuItem name="Show full cross" icon="Bundles/media_0-1/icons/FullCross.png" style="radio" />
                        <separator />
                        <menuItem name="Manage organs color" icon="Bundles/media_0-1/icons/ManageOrgan.png" style="check" />
                        <separator />
                        <menuItem name="Export Activity" icon="Bundles/media_0-1/icons/Export.svg" />
                        <spacer />
                        <menu name="Visu 3D" />
                    </layout>
                </gui>
                <registry>
                    <menuItem sid="${GENERIC_UID}_action_AxialViewMPR3D" start="no" />
                    <menuItem sid="${GENERIC_UID}_action_FrontalViewMPR3D" start="no" />
                    <menuItem sid="${GENERIC_UID}_action_SagittalViewMPR3D" start="no" />
                    <menuItem sid="${GENERIC_UID}_ActionNewLandmark" start="no" />
                    <menuItem sid="${GENERIC_UID}_ActionRemoveLandmark" start="no" />
                    <menuItem sid="${GENERIC_UID}_ActionLoadLandmark" start="no" />
                    <menuItem sid="${GENERIC_UID}_ActionSaveLandmark" start="no" />
                    <menuItem sid="${GENERIC_UID}_ActionFocusLandmark" start="no" />
                    <menuItem sid="${GENERIC_UID}_ActionHideLandmark" start="no" />
                    <menuItem sid="${GENERIC_UID}_ActionAddDistance" start="no" />
                    <menuItem sid="${GENERIC_UID}_ActionRemoveDistance" start="no" />
                    <menuItem sid="${GENERIC_UID}_ActionHideDistance" start="no" />
                    <menuItem sid="${GENERIC_UID}_ActionHideCross" start="no" />
                    <menuItem sid="${GENERIC_UID}_ActionShowNormalCross" start="no" />
                    <menuItem sid="${GENERIC_UID}_ActionShowFullCross" start="no" />
                    <menuItem sid="${GENERIC_UID}_action_organManager" start="no" />
                    <menuItem sid="${GENERIC_UID}_ActionExportActivity" start="yes" />
                    <menu sid="${GENERIC_UID}_menu" start="yes" />
                </registry>
            </service>


            <service uid="${GENERIC_UID}_menu" type="::fwGui::IMenuSrv" impl="::gui::aspect::DefaultMenuSrv" autoConnect="no">
                <gui>
                    <layout>
                        <menuItem name="Manage organs colors" style="check" shortcut="F9" icon="Bundles/media_0-1/icons/ManageOrgan.png" />
                        <separator />
                        <menuItem name="Axial view" icon="Bundles/media_0-1/icons/icon-axial.png" />
                        <menuItem name="Frontal view" icon="Bundles/media_0-1/icons/icon-frontal.png" />
                        <menuItem name="Sagittal view" icon="Bundles/media_0-1/icons/icon-sagittal.png" />
                    </layout>
                </gui>
                <registry>
                    <menuItem sid="${GENERIC_UID}_action_organManager" start="yes" />
                    <menuItem sid="${GENERIC_UID}_action_AxialViewMPR3D" start="no" />
                    <menuItem sid="${GENERIC_UID}_action_FrontalViewMPR3D" start="no" />
                    <menuItem sid="${GENERIC_UID}_action_SagittalViewMPR3D" start="no" />
                </registry>
            </service>

            <service uid="${GENERIC_UID}_action_organManager" type="::fwGui::IActionSrv" impl="::gui::action::SConfigLauncher" autoConnect="no">
                <config>
                    <appConfig id="OrganManagerWithSeries">
                        <parameters>
                            <parameter replace="ORGAN_MANAGER_MODELSERIES" by="${modelSeriesUid}" />
                            <parameter replace="ICON_PATH" by="${ICON_PATH}" />
                        </parameters>
                    </appConfig>
                </config>
            </service>

            <service uid="${GENERIC_UID}_cfgNegato1" impl="::fwServices::SConfigController" autoConnect="no">
                <config>
                    <appConfig id="3DNegatoWithAcq">
                        <parameters>
                            <parameter replace="InputImageCompositeUID" by="@values.OptionalInputImageCompositeKey" />
                            <parameter replace="modelSeriesUid" by="@values.modelSeriesKey" />
                            <parameter replace="orientation" by="axial" />
                            <parameter replace="WID_PARENT" by="${GENERIC_UID}_view_negato1" />
                            <parameter replace="patient_name" by="${patient_name}" />
                        </parameters>
                    </appConfig>
                </config>
            </service>



            <item key="OptionalInputImageCompositeKey">
                <object uid="${InputImageCompositeUID}" src="ref" type="::fwData::Composite">

                    <service uid="${GENERIC_UID}_2DViewManager" impl="::ctrlSelection::manager::SwapperSrv" autoConnect="yes">
                        <mode type="stop" />
                        <config>
                            <object id="OptionalInputImageKey" type="::fwData::Image">

                                <service uid="${GENERIC_UID}_LockImageSrv" impl="::ctrlMemory::LockDumpSrv" type="::fwServices::IController" autoConnect="no" />

                                <service uid="${GENERIC_UID}_cfgNegato2" type="::fwServices::IController" impl="::fwServices::SConfigController" autoConnect="no">
                                    <config>
                                        <appConfig id="2DNegato">
                                            <parameters>
                                                <parameter replace="imageUid" by="self" />
                                                <parameter replace="orientation" by="frontal" />
                                                <parameter replace="WID_PARENT" by="${GENERIC_UID}_view_negato2" />
                                                <parameter replace="patient_name" by="${patient_name}" />
                                            </parameters>
                                        </appConfig>
                                    </config>
                                </service>

                                <service uid="${GENERIC_UID}_cfgNegato3" type="::fwServices::IController" impl="::fwServices::SConfigController" autoConnect="no">
                                    <config>
                                        <appConfig id="2DNegato">
                                            <parameters>
                                                <parameter replace="imageUid" by="self" />
                                                <parameter replace="orientation" by="sagittal" />
                                                <parameter replace="WID_PARENT" by="${GENERIC_UID}_view_negato3" />
                                                <parameter replace="patient_name" by="${patient_name}" />
                                            </parameters>
                                        </appConfig>
                                    </config>
                                </service>


                                <service uid="${GENERIC_UID}_ActionFocusLandmark" type="::fwGui::IActionSrv" impl="::uiMeasurement::action::FocusLandmark" autoConnect="no" />
                                <service uid="${GENERIC_UID}_ActionNewLandmark" type="::fwGui::IActionSrv" impl="::uiMeasurement::action::AddLandmark" autoConnect="no" />
                                <service uid="${GENERIC_UID}_ActionRemoveLandmark" type="::fwGui::IActionSrv" impl="::uiMeasurement::action::RemoveLandmark" autoConnect="no" />
                                <service uid="${GENERIC_UID}_ActionLoadLandmark" type="::fwGui::IActionSrv" impl="::uiMeasurement::action::LoadLandmark" autoConnect="no" />
                                <service uid="${GENERIC_UID}_ActionSaveLandmark" type="::fwGui::IActionSrv" impl="::uiMeasurement::action::SaveLandmark" autoConnect="no" />
                                <service uid="${GENERIC_UID}_ActionHideLandmark" type="::fwGui::IActionSrv" impl="::uiMeasurement::action::ShowLandmark" autoConnect="yes" />
                                <service uid="${GENERIC_UID}_ActionAddDistance" type="::fwGui::IActionSrv" impl="::uiMeasurement::action::AddDistance" autoConnect="no" />
                                <service uid="${GENERIC_UID}_ActionRemoveDistance" type="::fwGui::IActionSrv" impl="::uiMeasurement::action::RemoveDistance" autoConnect="no" />
                                <service uid="${GENERIC_UID}_ActionHideDistance" type="::fwGui::IActionSrv" impl="::uiMeasurement::action::ShowDistance" autoConnect="yes" />

                                <service uid="${GENERIC_UID}_ActionHideCross" type="::fwGui::IActionSrv" impl="::uiVisu::action::CrossTypeAction" autoConnect="no">
                                    <crossType>hide</crossType>
                                </service>

                                <service uid="${GENERIC_UID}_ActionShowNormalCross" type="::fwGui::IActionSrv" impl="::uiVisu::action::CrossTypeAction" autoConnect="no">
                                    <crossType>half</crossType>
                                    <state active="true" />
                                </service>

                                <service uid="${GENERIC_UID}_ActionShowFullCross" type="::fwGui::IActionSrv" impl="::uiVisu::action::CrossTypeAction" autoConnect="no">
                                    <crossType>full</crossType>
                                </service>

                                <service uid="${GENERIC_UID}_action_SagittalViewMPR3D" type="::fwGui::IActionSrv" impl="::uiVisu::action::CameraOrientationAction" autoConnect="no">
                                    <orientation>sagittal</orientation>
                                </service>

                                <service uid="${GENERIC_UID}_action_FrontalViewMPR3D" type="::fwGui::IActionSrv" impl="::uiVisu::action::CameraOrientationAction" autoConnect="no">
                                    <orientation>frontal</orientation>
                                </service>

                                <service uid="${GENERIC_UID}_action_AxialViewMPR3D" type="::fwGui::IActionSrv" impl="::uiVisu::action::CameraOrientationAction" autoConnect="no">
                                    <orientation>axial</orientation>
                                </service>

                                <service uid="${GENERIC_UID}_MedicalImageSrv" impl="::ctrlSelection::MedicalImageSrv" type="::fwServices::IController" autoConnect="no" />


                            </object>
                        </config>
                    </service>


                    <service uid="${GENERIC_UID}_2DLayoutManager" impl="::ctrlSelection::manager::SwapperSrv" autoConnect="yes">
                        <mode type="startAndUpdate" />
                        <config>
                            <object id="OptionalInputImageKey" type="::fwData::Image">

                                <service uid="${GENERIC_UID}_ModifyLayout" type="::fwGui::IActionSrv" impl="::gui::action::ModifyLayoutActionSrv" autoConnect="no">
                                    <config>
                                        <show wid="${GENERIC_UID}_view_negato2" />
                                        <show wid="${GENERIC_UID}_view_negato3" />
                                    </config>
                                </service>


                            </object>
                        </config>
                    </service>



                </object>
            </item>




            <item key="seriesDB">
                <object uid="${SERIESDB}" src="ref" type="::fwMedData::SeriesDB">
                    <service uid="${GENERIC_UID}_ActionExportActivity" type="::fwGui::IActionSrv" impl="::uiMedData::action::SExportSeries" autoConnect="yes">
                        <seriesId>${AS_UID}</seriesId>
                    </service>
                </object>
            </item>

            <item key="activitySeries">
                <object uid="${AS_UID}" src="ref" type="::fwMedData::ActivitySeries" />
            </item>

            <item key="modelSeriesKey">
                <object uid="${modelSeriesUid}" src="ref" type="::fwMedData::ModelSeries" />
            </item>

            <!-- START AND STOP SERVICES -->
            <start uid="${GENERIC_UID}_mainView" />
            <start uid="${GENERIC_UID}_cfgNegato1" />
            <start uid="${GENERIC_UID}_2DViewManager" />
            <start uid="${GENERIC_UID}_2DLayoutManager" />

        </object>


    </config>
</extension>
