<extension implements="::fwServices::registry::AppConfig">
    <id>2DNegatoWithTF</id>
    <type>parameters</type>
    <parameters>
        <param name="WID_PARENT" />
        <param name="GENERIC_UID" />
        <param name="imageUid" />
        <param name="selectedTFKey" />
        <param name="TFSelectionsUid" />
        <param name="patient_name" default="" />
        <param name="orientation" default="axial" /> <!-- axial, frontal, sagittal -->
    </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::LineLayoutManager">
                        <orientation value="vertical" />
                        <view proportion="1" />
                        <view proportion="0" minHeight="30" />
                    </layout>
                </gui>
                <registry>
                    <parent wid="${WID_PARENT}" />
                    <view sid="${GENERIC_UID}_negato" start="yes" />
                    <view sid="${GENERIC_UID}_multiView_negato_bottom" start="yes" />
                </registry>
            </service>

            <service uid="${GENERIC_UID}_multiView_negato_bottom" type="::gui::view::IView" impl="::gui::view::DefaultView" autoConnect="no">
                <gui>
                    <layout type="::fwGui::LineLayoutManager">
                        <orientation value="horizontal" />
                        <view proportion="0" minWidth="30" />
                        <view proportion="1" />
                        <view proportion="0" minWidth="30" />
                    </layout>
                </gui>
                <registry>
                    <view sid="${GENERIC_UID}_snapshotNegatoEditor" start="yes" />
                    <view sid="${GENERIC_UID}_slider_negato" start="yes" />
                    <view sid="${GENERIC_UID}_distanceNegatoEditor" start="yes" />
                </registry>
            </service>

            <service uid="${GENERIC_UID}_snapshotNegatoEditor" type="::gui::editor::IEditor" impl="::uiVisu::SnapshotEditor" autoConnect="no">
                <snap>
                    <scene uid="${GENERIC_UID}_negato" />
                </snap>
            </service>

            <!-- GENERIC SCENE DEFINITION -->
            <item key="visuConfig">
                <object uid="${GENERIC_UID}_VisuComposite" type="::fwData::Composite">

                    <!-- Generic Scene Negato -->
                    <service uid="${GENERIC_UID}_negato" impl="::fwRenderVTK::VtkRenderService" type="::fwRender::IRender" autoConnect="yes">
                        <scene>

                            <picker id="negatodefault" vtkclass="fwVtkCellPicker" />

                            <renderer id="default" background="0.0" />

                            <adaptor id="renderNegato" class="::visuVTKAdaptor::Render" objectId="self">
                                <config renderer="default" />
                            </adaptor>

                            <adaptor id="snapshot" class="::visuVTKAdaptor::Snapshot" objectId="self">
                                <config renderer="default" />
                            </adaptor>

                            <adaptor id="interactor" class="::visuVTKAdaptor::InteractorStyle" objectId="self">
                                <config renderer="default" style="InteractorStyle2DForNegato" />
                            </adaptor>

                            <adaptor id="MPRNegato" class="::visuVTKAdaptor::NegatoMPR" objectId="imageKey">
                                <config renderer="default" picker="negatodefault" mode="2d" slices="1" sliceIndex="${orientation}" selectedTFKey="${selectedTFKey}" tfSelectionFwID="${TFSelectionsUid}"/>
                            </adaptor>

                            <adaptor id="text" class="::visuVTKAdaptor::ImageText" objectId="imageKey">
                                <config renderer="default" picker="negatodefault" text="" selectedTFKey="${selectedTFKey}" tfSelectionFwID="${TFSelectionsUid}"/>
                            </adaptor>

                            <adaptor id="multiDistances" class="::visuVTKAdaptor::ImageMultiDistances" objectId="imageKey">
                                <config filter="true" renderer="default" picker="negatodefault" />
                            </adaptor>

                            <adaptor id="landmarksNegato" class="::visuVTKAdaptor::ImageLandmarks" objectId="imageKey">
                                <config renderer="default" picker="negatodefault" />
                            </adaptor>

                            <adaptor id="nameAdaptor" class="::visuVTKAdaptor::Text" objectId="imageKey">
                                <config renderer="default" text="${patient_name}" fontSize="15" hAlign="right" vAlign="top" />
                            </adaptor>

                        </scene>
                    </service>

                    <item key="imageKey">
                        <object uid="${imageUid}" src="ref" type="::fwData::Image">

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

                            <service uid="${GENERIC_UID}_slider_negato" impl="::uiImage::SliceIndexPositionEditor" type="::gui::editor::IEditor" autoConnect="yes">
                                <sliceIndex>${orientation}</sliceIndex>
                            </service>

                            <service uid="${GENERIC_UID}_distanceNegatoEditor" type="::gui::editor::IEditor" impl="::uiMeasurement::editor::Distance" autoConnect="no">
                                <placeInScene uid="${GENERIC_UID}_negato" />
                            </service>

                        </object>
                    </item>

                </object>
            </item>

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

        </object>
    </config>
</extension>
