vtkWidgets
vtkImaging
vtkHybrid
- QVTK
+ vtkQVTK
)
ENDIF(VTK_VERSION VERSION_LESS 5.8.0)
ELSE(VTK_FOUND)
::GenerateData()
{
- // std::cout <<"GenerateData" << std::endl;
-
this->AllocateOutputs();
computeDirection();
typename InputImageType::ConstPointer input = this->GetInput();
if(!m_Fast)
{
- DD(m_Fast);
for(int i=0;i<pow((double)2,(int)ImageDimension);i++)
{
int orient[ImageDimension];
itkSetMacro(FuzzyMapOnlyFlag, bool);
itkBooleanMacro(FuzzyMapOnlyFlag);
+ itkGetConstMacro(FastFlag, bool);
+ itkSetMacro(FastFlag, bool);
+ itkBooleanMacro(FastFlag);
+
+ itkGetConstMacro(Radius, double);
+ itkSetMacro(Radius, double);
+
typename FloatImageType::Pointer GetFuzzyMap() { return m_FuzzyMap; }
// I dont want to verify inputs information
bool m_RemoveObjectFlag;
bool m_CombineWithOrFlag;
bool m_FuzzyMapOnlyFlag;
+ bool m_FastFlag;
+ double m_Radius;
virtual void GenerateOutputInformation();
virtual void GenerateInputRequestedRegion();
virtual void GenerateData();
typedef itk::PasteImageFilter<ImageType,ImageType> PasteFilterType;
+ typedef itk::PasteImageFilter<FloatImageType,FloatImageType> PasteFloatFilterType;
typename ImageType::Pointer working_image;
typename ImageType::Pointer object_resampled;
typename FloatImageType::Pointer relPos;
VerboseStepFlagOff();
WriteStepFlagOff();
FuzzyMapOnlyFlagOff();
+ FastFlagOff();
+ SetRadius(2.0);
}
//--------------------------------------------------------------------
for(int i=0; i<GetNumberOfAngles(); i++) {
// Compute fuzzy map
relPosFilter = RelPosFilterType::New();
+ relPosFilter->SetFast(GetFastFlag());
+ relPosFilter->SetRadius(GetRadius());
relPosFilter->SetInput(working_image);
relPosFilter->SetAlpha1(m_Angle1[i]); // xy plane
relPosFilter->SetAlpha2(m_Angle2[i]);
relPosFilter->SetK1(M_PI/2.0); // Opening parameter, default = pi/2
- relPosFilter->SetFast(true);
- relPosFilter->SetRadius(1); // seems sufficient in this case
+
+ // relPosFilter->SetFast(true);
+ // relPosFilter->SetRadius(1); // seems sufficient in this case
+
// relPosFilter->SetVerboseProgress(true);
relPosFilter->Update();
relPos = relPosFilter->GetOutput();
relPos = m_FuzzyMap;
StopCurrentStep<FloatImageType>(relPos);
- if (GetFuzzyMapOnlyFlag()) return;
+ if (GetFuzzyMapOnlyFlag()) {
+ // If the spacing is used, recompute fuzzy map with the input size/spacing
+ if (m_IntermediateSpacingFlag) {
+ StartNewStep("Resample FuzzyMap to come back to the same sampling than input");
+ typedef clitk::ResampleImageWithOptionsFilter<FloatImageType> ResampleFilterType;
+ typename ResampleFilterType::Pointer resampleFilter = ResampleFilterType::New();
+ resampleFilter->SetDefaultPixelValue(0.0); //Default fuzzymap value FIXME
+ resampleFilter->SetInput(relPos);
+ resampleFilter->SetOutputSpacing(input->GetSpacing());
+ resampleFilter->SetGaussianFilteringEnabled(false);
+ resampleFilter->Update();
+ relPos = m_FuzzyMap = resampleFilter->GetOutput();
+
+ // Need to put exactly the same size
+ if (relPos->GetLargestPossibleRegion() != input->GetLargestPossibleRegion()) {
+ StartNewStep("Pad to get the same size than input");
+ typename FloatImageType::Pointer temp = FloatImageType::New();
+ temp->CopyInformation(input);
+ temp->SetRegions(input->GetLargestPossibleRegion()); // Do not forget !!
+ temp->Allocate();
+ temp->FillBuffer(0.0); // Default fuzzymap value FIXME
+ typename PasteFloatFilterType::Pointer padFilter2 = PasteFloatFilterType::New();
+ padFilter2->SetSourceImage(relPos);
+ padFilter2->SetDestinationImage(temp);
+ padFilter2->SetDestinationIndex(input->GetLargestPossibleRegion().GetIndex());
+ padFilter2->SetSourceRegion(relPos->GetLargestPossibleRegion());
+ padFilter2->Update();
+ relPos = padFilter2->GetOutput();
+ StopCurrentStep<FloatImageType>(relPos);
+ m_FuzzyMap = relPos;
+ }
+ }
+ else {
+ StopCurrentStep<FloatImageType>(relPos);
+ }
+ return;
+ }
//--------------------------------------------------------------------
//--------------------------------------------------------------------
===========================================================================**/
#ifndef CLITKLABELIMAGEOVERLAPMEASUREFILTER_H
-#define CLITKRELATIVEPOSITIONANALYZERFILTER_H
+#define CLITKLABELIMAGEOVERLAPMEASUREFILTER_H
// clitk
#include "clitkFilterBase.h"
clitk::Or<ImageType>(image_union, input2, GetBackgroundValue());
clitk::And<ImageType>(image_intersection, input2, GetBackgroundValue());
- writeImage<ImageType>(image_union, "union.mha");
- writeImage<ImageType>(image_intersection, "intersection.mha");
+ // writeImage<ImageType>(image_union, "union.mha");
+ // writeImage<ImageType>(image_intersection, "intersection.mha");
// Compute size
typedef itk::LabelStatisticsImageFilter<ImageType, ImageType> StatFilterType;
statFilter->Update();
int in2 = statFilter->GetCount(GetLabel1());
- std::cout << in1 << " " << in2 << " " << inter << " " << u << " " << (double)inter/(double)u << std::endl;
+ std::cout << in1 << " " << in2 << " " << inter << " " << u << " " << 2.0*(double)inter/(double)(in1+in2) << std::endl;
}
//--------------------------------------------------------------------
itkSetMacro(Extrude, bool);
itkGetMacro(Extrude, bool);
+ itkBooleanMacro(Extrude);
protected:
MeshToBinaryImageFilter();
// We extrude in the -slice_spacing direction to respect the FOCAL convention
extrude->SetVector(0, 0, -m_LikeImage->GetSpacing()[2]);
sts->SetInput(extrude->GetOutput());
+
+ // When extrude ScaleFactor indicate the extrusion scaling (default = 1)
+ /*
+ extrude->SetScaleFactor(m_LikeImage->GetSpacing()[2]/2.0);
+ DD(extrude->GetScaleFactor());
+ DD(extrude->GetCapping());
+ */
}
else
sts->SetInput(m_Mesh);
<< "ObjectCCLSelectionFlag = " << this->GetObjectCCLSelectionFlag() << std::endl
<< "ObjectCCLSelectionDimension = " << this->GetObjectCCLSelectionDimension() << std::endl
<< "ObjectCCLSelectionIgnoreSingleCCLFlag = " << this->GetObjectCCLSelectionIgnoreSingleCCLFlag() << std::endl
- << "IgnoreEmptySliceObjectFlag = " << this->GetIgnoreEmptySliceObjectFlag() << std::endl;
+ << "IgnoreEmptySliceObjectFlag = " << this->GetIgnoreEmptySliceObjectFlag() << std::endl
+ << "(RP) FastFlag = " << this->GetFastFlag() << std::endl
+ << "(RP) Radius = " << this->GetRadius() << std::endl;
}
//--------------------------------------------------------------------
m_working_object = clitk::ResizeImageLike<ImageType>(m_working_object,
m_working_input,
this->GetObjectBackgroundValue());
+
+ // End
this->template StopCurrentStep<ImageType>(m_working_input);
}
//--------------------------------------------------------------------
// Perform slice by slice relative position
- this->StartNewStep("Perform slice by slice relative position");
+ this->StartNewStep("Perform slice by slice relative position ("+toString(mInputSlices.size())+")");
for(unsigned int i=0; i<mInputSlices.size(); i++) {
// Count the number of CCL (allow to ignore empty slice)
// Relative position
typedef clitk::AddRelativePositionConstraintToLabelImageFilter<SliceType> RelPosFilterType;
typename RelPosFilterType::Pointer relPosFilter = RelPosFilterType::New();
-
relPosFilter->VerboseStepFlagOff();
relPosFilter->WriteStepFlagOff();
// relPosFilter->VerboseMemoryFlagOn();
- relPosFilter->SetCurrentStepBaseId(this->GetCurrentStepId()+"-"+toString(i));
-
+ relPosFilter->SetCurrentStepBaseId(this->GetCurrentStepId()+"-"+toString(i));
relPosFilter->SetBackgroundValue(this->GetBackgroundValue());
relPosFilter->SetInput(mInputSlices[i]);
relPosFilter->SetInputObject(mObjectSlices[i]);
- relPosFilter->SetRemoveObjectFlag(this->GetRemoveObjectFlag());
-
+ relPosFilter->SetRemoveObjectFlag(this->GetRemoveObjectFlag());
// This flag (InverseOrientation) *must* be set before
// AddOrientation because AddOrientation can change it.
relPosFilter->SetInverseOrientationFlag(this->GetInverseOrientationFlag());
relPosFilter->SetFuzzyThreshold(this->GetFuzzyThreshold());
relPosFilter->AutoCropFlagOff(); // important ! because we join the slices after this loop
relPosFilter->SetCombineWithOrFlag(this->GetCombineWithOrFlag());
-
// should we stop after fuzzy map ?
relPosFilter->SetFuzzyMapOnlyFlag(this->GetFuzzyMapOnlyFlag());
- // relPosFilter->SetComputeFuzzyMapFlag(this->GetComputeFuzzyMapFlag());
-
+ // relPosFilter->SetComputeFuzzyMapFlag(this->GetComputeFuzzyMapFlag());
+ relPosFilter->SetFastFlag(this->GetFastFlag());
+ relPosFilter->SetRadius(this->GetRadius());
+
// Go !
relPosFilter->Update();
itkSetMacro(InputName, std::string);
itkGetConstMacro(InputName, std::string);
+ itkGetConstMacro(ComputeOverlapFlag, bool);
+ itkSetMacro(ComputeOverlapFlag, bool);
+ itkBooleanMacro(ComputeOverlapFlag);
+
void Read(std::string filename);
void SetFilterOptions(typename RelPosFilterType::Pointer filter, ArgsInfoType & options);
+ void SetReferenceImageForOverlapMeasure(ImagePointer ref);
protected:
RelativePositionList();
typename SliceRelPosFilterType::Pointer mFilter;
std::vector<ArgsInfoType> mArgsInfoList;
ImagePointer m_working_input;
+ ImagePointer m_reference;
+ bool m_ComputeOverlapFlag;
}; // end class
//--------------------------------------------------------------------
- CeCILL-B http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
======================================================================-====*/
+#include "clitkLabelImageOverlapMeasureFilter.h"
//--------------------------------------------------------------------
template <class TImageType>
clitk::RelativePositionList<TImageType>::
RelativePositionList() {
+ ComputeOverlapFlagOff();
+}
+//--------------------------------------------------------------------
+
+
+//--------------------------------------------------------------------
+template <class TImageType>
+void
+clitk::RelativePositionList<TImageType>::
+SetReferenceImageForOverlapMeasure(ImagePointer ref) {
+ m_reference = ref;
+ ComputeOverlapFlagOn();
}
//--------------------------------------------------------------------
std::ofstream os;
openFileForWriting(os, tmpfilename);
os << text;
+ os << "input = nothing" << std::endl;
+ os << "output = nothing" << std::endl;
os.close();
// Create a struct to store options. I use two step to allow to
std::copy(tmpfilename.begin(), tmpfilename.end(), writable.begin());
char ** argv = new char*[1];
argv[0] = new char[1];
- cmdline_parser_clitkRelativePosition2(1, argv, &args_info, 1, 1, 0);
- args_info.input_given = 1;
- args_info.input_arg = new char[1];
- args_info.output_given = 1;
- args_info.output_arg = new char[1];
- cmdline_parser_clitkRelativePosition_configfile(&writable[0], &args_info, 0, 0, 1);
-
- // Store the args
+ struct cmdline_parser_clitkRelativePosition_params params;
+ params.override = 0;
+ params.initialize = 1;
+ params.check_required = 0;
+ cmdline_parser_clitkRelativePosition_configfile(&writable[0], &args_info, 1, 1, 1);
mArgsInfoList.push_back(args_info);
// Delete the temporary file
text += " slice by slice";
}
else text += " 3D";
+ text += " spacing=" + toString(mArgsInfoList[i].spacing_arg);
StartNewStep(text);
typename RelPosFilterType::Pointer relPosFilter;
relPosFilter->Update();
m_working_input = relPosFilter->GetOutput();
StopCurrentStep<ImageType>(m_working_input);
- // clitk::PrintMemory(true, "End");
+
+ // Compute overlap with reference if needed
+ if (GetComputeOverlapFlag()) {
+ typedef clitk::LabelImageOverlapMeasureFilter<ImageType> FilterType;
+ typename FilterType::Pointer filter = FilterType::New();
+ filter->SetInput(0, m_working_input);
+ filter->SetInput(1, m_reference);
+ filter->Update();
+ }
+
}
}
//--------------------------------------------------------------------
// RelativePositionList management
void AddRelativePositionListFilename(std::string s);
- MaskImagePointer ApplyRelativePositionList(std::string name, MaskImageType * input);
+ MaskImagePointer ApplyRelativePositionList(std::string name, MaskImageType * input, bool overlap=false);
protected:
StructuresExtractionFilter();
template <class TImageType>
typename clitk::StructuresExtractionFilter<TImageType>::MaskImagePointer
clitk::StructuresExtractionFilter<TImageType>::
-ApplyRelativePositionList(std::string name, MaskImageType * input)
+ApplyRelativePositionList(std::string name, MaskImageType * input, bool overlap)
{
// Create all RelativePositionList
for(unsigned int i=0; i<mListOfRelativePositionListFilename.size(); i++) {
relpos->SetCurrentStepNumber(GetCurrentStepNumber());
relpos->SetWriteStepFlag(GetWriteStepFlag());
relpos->SetInput(input);
+ if (overlap) {
+ std::string n = name.substr(8,2);
+ MaskImagePointer ref = this->GetAFDB()->template GetImage <MaskImageType>("S"+n+"_Ref");
+ relpos->SetReferenceImageForOverlapMeasure(ref);
+ }
relpos->Update();
input = relpos->GetOutput();
+
SetCurrentStepNumber(relpos->GetCurrentStepNumber());
}
return input;
vvToolStructureSetManager
vvToolMIP
vvToolConvert ## with dummy vvToolConvert.ui
-
+ vvToolROIManager
+
## these ones are for tests (not working)
# vvToolFoo
# vvToolFooWithWidgetBase
<property name="text">
<string>Open image(s)</string>
</property>
+ <property name="iconVisibleInMenu">
+ <bool>true</bool>
+ </property>
</action>
<action name="actionClose_image">
<property name="text">
<property name="text">
<string>Exit</string>
</property>
+ <property name="iconVisibleInMenu">
+ <bool>true</bool>
+ </property>
</action>
<action name="actionSave_screenshot">
<property name="text">
<property name="text">
<string>About</string>
</property>
+ <property name="iconVisibleInMenu">
+ <bool>true</bool>
+ </property>
</action>
<action name="actionReload_images">
<property name="text">
<property name="text">
<string>Open Dicom</string>
</property>
+ <property name="iconVisibleInMenu">
+ <bool>true</bool>
+ </property>
</action>
<action name="actionOpen_Multiple_Images_As_One">
<property name="icon">
<property name="text">
<string>Merge several nD images into a single (n+1)D image</string>
</property>
+ <property name="iconVisibleInMenu">
+ <bool>true</bool>
+ </property>
</action>
<action name="actionSlice_Image_As_Multiple_Images">
<property name="icon">
<property name="text">
<string>Slice a nD image into several (n-1)D images</string>
</property>
+ <property name="iconVisibleInMenu">
+ <bool>true</bool>
+ </property>
</action>
<action name="actionOpen_one_Image_as_Multiple">
<property name="text">
<property name="shortcut">
<string>Ctrl+S</string>
</property>
+ <property name="iconVisibleInMenu">
+ <bool>true</bool>
+ </property>
</action>
<action name="actionAdd_VF_to_current_Image">
<property name="icon">
<property name="text">
<string>Save image in TL</string>
</property>
+ <property name="iconVisibleInMenu">
+ <bool>true</bool>
+ </property>
</action>
<action name="actionNorth_East_Window">
<property name="icon">
<property name="text">
<string>Save image in TR</string>
</property>
+ <property name="iconVisibleInMenu">
+ <bool>true</bool>
+ </property>
</action>
<action name="actionSouth_West_Window">
<property name="icon">
<property name="text">
<string>Save image in BL</string>
</property>
+ <property name="iconVisibleInMenu">
+ <bool>true</bool>
+ </property>
</action>
<action name="actionSouth_East_Window">
<property name="icon">
<property name="text">
<string>Save image in BR</string>
</property>
+ <property name="iconVisibleInMenu">
+ <bool>true</bool>
+ </property>
</action>
<action name="actionOpen_Image_With_Time">
<property name="icon">
<property name="text">
<string>Open a nD image as a (n-1)D + t image</string>
</property>
+ <property name="iconVisibleInMenu">
+ <bool>true</bool>
+ </property>
</action>
<action name="actionMerge_images_as_n_dim_t">
<property name="icon">
<property name="text">
<string>Open several nD images into a single nD+t image</string>
</property>
+ <property name="iconVisibleInMenu">
+ <bool>true</bool>
+ </property>
</action>
<action name="actionAdd_fusion_image">
<property name="icon">
<property name="text">
<string>Add fusion image to current image</string>
</property>
+ <property name="iconVisibleInMenu">
+ <bool>true</bool>
+ </property>
</action>
<action name="actionSegmentation">
<property name="text">
<string>Segmentation</string>
</property>
+ <property name="iconVisibleInMenu">
+ <bool>true</bool>
+ </property>
</action>
<action name="actionResampler">
<property name="text">
<property name="text">
<string>Surface Viewer</string>
</property>
+ <property name="iconVisibleInMenu">
+ <bool>true</bool>
+ </property>
</action>
<action name="actionDebug">
<property name="text">
<property name="text">
<string>Deformable Registration</string>
</property>
+ <property name="iconVisibleInMenu">
+ <bool>true</bool>
+ </property>
</action>
<action name="actionWarp_image_with_vector_field">
<property name="text">
<string>Verify Registration</string>
</property>
+ <property name="iconVisibleInMenu">
+ <bool>true</bool>
+ </property>
</action>
<action name="actionMaximum_Intensity_Projection">
<property name="text">
<property name="text">
<string>Open VTK or OBJ contour</string>
</property>
+ <property name="iconVisibleInMenu">
+ <bool>true</bool>
+ </property>
</action>
<action name="actionNavigation_Help">
<property name="text">
<property name="shortcut">
<string>F1</string>
</property>
+ <property name="iconVisibleInMenu">
+ <bool>true</bool>
+ </property>
</action>
<action name="actionOpen_Dicom_Struct">
<property name="icon">
<property name="text">
<string>Open Dicom-Struct</string>
</property>
+ <property name="iconVisibleInMenu">
+ <bool>true</bool>
+ </property>
</action>
<action name="actionCompute_mid_position_image">
<property name="text">
<string>Compute mid-position image</string>
</property>
+ <property name="iconVisibleInMenu">
+ <bool>true</bool>
+ </property>
</action>
<action name="actionExperimental">
<property name="text">
<property name="text">
<string>Register vv</string>
</property>
+ <property name="iconVisibleInMenu">
+ <bool>true</bool>
+ </property>
</action>
<action name="actionSave_all_slices">
<property name="text">
<property name="toolTip">
<string>Save current window and file states</string>
</property>
+ <property name="iconVisibleInMenu">
+ <bool>true</bool>
+ </property>
</action>
<action name="actionRead_saved_state">
<property name="icon">
<property name="text">
<string>Read Saved State</string>
</property>
+ <property name="iconVisibleInMenu">
+ <bool>true</bool>
+ </property>
</action>
<action name="actionAdd_overlay_image_to_current_image">
<property name="icon">
<rect>
<x>0</x>
<y>0</y>
- <width>411</width>
- <height>534</height>
+ <width>350</width>
+ <height>708</height>
</rect>
</property>
<property name="sizePolicy">
<property name="windowTitle">
<string>Form</string>
</property>
- <layout class="QVBoxLayout" name="verticalLayout_3">
+ <layout class="QVBoxLayout" name="verticalLayout_5">
+ <property name="spacing">
+ <number>2</number>
+ </property>
+ <property name="margin">
+ <number>2</number>
+ </property>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
</property>
</spacer>
</item>
- <item>
- <widget class="QPushButton" name="mCloseButton">
- <property name="toolTip">
- <string/>
- </property>
- <property name="autoFillBackground">
- <bool>false</bool>
- </property>
- <property name="text">
- <string/>
- </property>
- <property name="icon">
- <iconset resource="../vvIcons.qrc">
- <normaloff>:/common/icons/exit.png</normaloff>:/common/icons/exit.png</iconset>
- </property>
- </widget>
- </item>
</layout>
</item>
<item>
- <layout class="QHBoxLayout" name="horizontalLayout">
- <item>
- <widget class="QLabel" name="vectorFieldNameLabel_4">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="text">
- <string>Load ROI from image</string>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QPushButton" name="mOpenBinaryButton">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="maximumSize">
- <size>
- <width>24</width>
- <height>24</height>
- </size>
- </property>
- <property name="toolTip">
- <string>Open label image</string>
- </property>
- <property name="text">
- <string/>
- </property>
- <property name="icon">
- <iconset resource="../vvIcons.qrc">
- <normaloff>:/common/icons/fileopen.png</normaloff>:/common/icons/fileopen.png</iconset>
- </property>
- </widget>
- </item>
- <item>
- <spacer name="horizontalSpacer_4">
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>40</width>
- <height>20</height>
- </size>
- </property>
- </spacer>
- </item>
- <item>
- <widget class="QLabel" name="dimensionStaticLabel">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="text">
- <string>BG</string>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QSpinBox" name="mBackgroundValueSpinBox"/>
- </item>
- <item>
- <spacer name="horizontalSpacer_2">
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>40</width>
- <height>20</height>
- </size>
- </property>
- </spacer>
- </item>
- </layout>
+ <widget class="QFrame" name="frame_3">
+ <property name="frameShape">
+ <enum>QFrame::StyledPanel</enum>
+ </property>
+ <property name="frameShadow">
+ <enum>QFrame::Raised</enum>
+ </property>
+ <layout class="QHBoxLayout" name="horizontalLayout">
+ <property name="spacing">
+ <number>2</number>
+ </property>
+ <property name="margin">
+ <number>2</number>
+ </property>
+ <item>
+ <widget class="QLabel" name="vectorFieldNameLabel_4">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Load ROI from image</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QPushButton" name="mOpenBinaryButton">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>24</width>
+ <height>24</height>
+ </size>
+ </property>
+ <property name="toolTip">
+ <string>Open label image</string>
+ </property>
+ <property name="text">
+ <string/>
+ </property>
+ <property name="icon">
+ <iconset resource="../vvIcons.qrc">
+ <normaloff>:/common/icons/fileopen.png</normaloff>:/common/icons/fileopen.png</iconset>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer name="horizontalSpacer_4">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>54</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QLabel" name="dimensionStaticLabel">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>BG</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QSpinBox" name="mBackgroundValueSpinBox"/>
+ </item>
+ <item>
+ <widget class="QCheckBox" name="mBGModeCheckBox">
+ <property name="toolTip">
+ <string>Tick if you want to consider FG mode instead of BG mode.</string>
+ </property>
+ <property name="text">
+ <string>FG ?</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item>
+ <widget class="QFrame" name="frame_4">
+ <property name="enabled">
+ <bool>true</bool>
+ </property>
+ <property name="frameShape">
+ <enum>QFrame::StyledPanel</enum>
+ </property>
+ <property name="frameShadow">
+ <enum>QFrame::Raised</enum>
+ </property>
+ <layout class="QHBoxLayout" name="horizontalLayout_10">
+ <property name="spacing">
+ <number>2</number>
+ </property>
+ <property name="margin">
+ <number>2</number>
+ </property>
+ <item>
+ <widget class="QLabel" name="vectorFieldNameLabel_5">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Load DICOM-RT-Struct</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QPushButton" name="mOpenDicomButton">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>24</width>
+ <height>24</height>
+ </size>
+ </property>
+ <property name="toolTip">
+ <string>Open label image</string>
+ </property>
+ <property name="text">
+ <string/>
+ </property>
+ <property name="icon">
+ <iconset resource="../vvIcons.qrc">
+ <normaloff>:/common/icons/fileopen.png</normaloff>:/common/icons/fileopen.png</iconset>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer name="horizontalSpacer_6">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </widget>
</item>
<item>
<widget class="QTreeWidget" name="mTree">
<verstretch>0</verstretch>
</sizepolicy>
</property>
+ <property name="minimumSize">
+ <size>
+ <width>0</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="font">
+ <font>
+ <pointsize>9</pointsize>
+ </font>
+ </property>
<property name="editTriggers">
<set>QAbstractItemView::AllEditTriggers</set>
</property>
</widget>
</item>
<item>
- <widget class="QGroupBox" name="mGroupBoxROI">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
+ <widget class="QFrame" name="frame">
+ <property name="frameShape">
+ <enum>QFrame::StyledPanel</enum>
</property>
- <property name="title">
- <string>Selected ROI</string>
+ <property name="frameShadow">
+ <enum>QFrame::Raised</enum>
</property>
- <layout class="QVBoxLayout" name="verticalLayout">
- <item>
- <layout class="QHBoxLayout" name="horizontalLayout_8">
- <item>
- <widget class="QCheckBox" name="mCheckBoxShow">
- <property name="text">
- <string>Visible</string>
- </property>
- <property name="checked">
- <bool>false</bool>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QPushButton" name="mChangeColorButton">
- <property name="toolTip">
- <string/>
- </property>
- <property name="autoFillBackground">
- <bool>false</bool>
- </property>
- <property name="text">
- <string>Color</string>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QPushButton" name="mReloadButton">
- <property name="toolTip">
- <string>Reload image</string>
- </property>
- <property name="autoFillBackground">
- <bool>false</bool>
- </property>
- <property name="text">
- <string/>
- </property>
- <property name="icon">
- <iconset resource="../vvIcons.qrc">
- <normaloff>:/common/icons/rotateright.png</normaloff>:/common/icons/rotateright.png</iconset>
- </property>
- </widget>
- </item>
- </layout>
- </item>
- <item>
- <layout class="QHBoxLayout" name="horizontalLayout_5">
- <item>
- <widget class="QLabel" name="vectorFieldNameLabel_7">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="text">
- <string>Opacity</string>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QSlider" name="mOpacitySlider">
- <property name="maximum">
- <number>100</number>
- </property>
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QSpinBox" name="mOpacitySpinBox">
- <property name="maximum">
- <number>100</number>
- </property>
- </widget>
- </item>
- </layout>
+ <layout class="QGridLayout" name="gridLayout">
+ <property name="margin">
+ <number>2</number>
+ </property>
+ <property name="spacing">
+ <number>2</number>
+ </property>
+ <item row="0" column="0">
+ <widget class="QGroupBox" name="mGroupBoxROI">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="title">
+ <string>Selected ROI</string>
+ </property>
+ <layout class="QVBoxLayout" name="verticalLayout">
+ <property name="spacing">
+ <number>2</number>
+ </property>
+ <property name="margin">
+ <number>2</number>
+ </property>
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout_8">
+ <property name="spacing">
+ <number>1</number>
+ </property>
+ <item>
+ <widget class="QCheckBox" name="mCheckBoxShow">
+ <property name="text">
+ <string>Visible</string>
+ </property>
+ <property name="checked">
+ <bool>false</bool>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QPushButton" name="mChangeColorButton">
+ <property name="toolTip">
+ <string/>
+ </property>
+ <property name="autoFillBackground">
+ <bool>false</bool>
+ </property>
+ <property name="text">
+ <string>Color</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QPushButton" name="mReloadButton">
+ <property name="toolTip">
+ <string>Reload image</string>
+ </property>
+ <property name="autoFillBackground">
+ <bool>false</bool>
+ </property>
+ <property name="text">
+ <string/>
+ </property>
+ <property name="icon">
+ <iconset resource="../vvIcons.qrc">
+ <normaloff>:/common/icons/rotateright.png</normaloff>:/common/icons/rotateright.png</iconset>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout_5">
+ <property name="spacing">
+ <number>2</number>
+ </property>
+ <item>
+ <widget class="QLabel" name="vectorFieldNameLabel_7">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Opacity</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QSlider" name="mOpacitySlider">
+ <property name="maximum">
+ <number>100</number>
+ </property>
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QSpinBox" name="mOpacitySpinBox">
+ <property name="maximum">
+ <number>100</number>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout_9">
+ <property name="spacing">
+ <number>2</number>
+ </property>
+ <item>
+ <widget class="QCheckBox" name="mContourCheckBoxShow">
+ <property name="text">
+ <string>Contour</string>
+ </property>
+ <property name="checked">
+ <bool>false</bool>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QPushButton" name="mChangeContourColorButton">
+ <property name="toolTip">
+ <string/>
+ </property>
+ <property name="autoFillBackground">
+ <bool>false</bool>
+ </property>
+ <property name="text">
+ <string>Color</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer name="horizontalSpacer_2">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout_6">
+ <item>
+ <widget class="QLabel" name="mROInameLabel_2">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Width</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QSpinBox" name="mContourWidthSpinBox">
+ <property name="minimum">
+ <number>1</number>
+ </property>
+ <property name="maximum">
+ <number>10</number>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout_3">
+ <property name="spacing">
+ <number>2</number>
+ </property>
+ <item>
+ <widget class="QLabel" name="mROInameLabel">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string> </string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer name="horizontalSpacer_5">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QLabel" name="mROInameLabel_3">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Depth</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QSpinBox" name="mDepthSpinBox">
+ <property name="minimum">
+ <number>1</number>
+ </property>
+ <property name="maximum">
+ <number>999999</number>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
</item>
- <item>
- <layout class="QHBoxLayout" name="horizontalLayout_9">
- <item>
- <widget class="QCheckBox" name="mContourCheckBoxShow">
- <property name="text">
- <string>Contour</string>
- </property>
- <property name="checked">
- <bool>false</bool>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QPushButton" name="mChangeContourColorButton">
- <property name="toolTip">
- <string/>
- </property>
- <property name="autoFillBackground">
- <bool>false</bool>
- </property>
- <property name="text">
- <string>Color</string>
+ </layout>
+ </widget>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout_7">
+ <property name="spacing">
+ <number>2</number>
+ </property>
+ <item>
+ <widget class="QFrame" name="frame_2">
+ <property name="frameShape">
+ <enum>QFrame::StyledPanel</enum>
+ </property>
+ <property name="frameShadow">
+ <enum>QFrame::Raised</enum>
+ </property>
+ <layout class="QGridLayout" name="gridLayout_2">
+ <property name="margin">
+ <number>2</number>
+ </property>
+ <property name="spacing">
+ <number>2</number>
+ </property>
+ <item row="0" column="0">
+ <layout class="QHBoxLayout" name="horizontalLayout_4">
+ <property name="spacing">
+ <number>2</number>
</property>
- </widget>
- </item>
- <item>
- <layout class="QHBoxLayout" name="horizontalLayout_6">
<item>
- <widget class="QLabel" name="mROInameLabel_2">
+ <widget class="QGroupBox" name="groupBox">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
- <property name="text">
- <string>Width</string>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QSpinBox" name="mContourWidthSpinBox">
- <property name="minimum">
- <number>1</number>
- </property>
- <property name="maximum">
- <number>10</number>
+ <property name="title">
+ <string>All ROI</string>
</property>
+ <layout class="QVBoxLayout" name="verticalLayout_2">
+ <property name="spacing">
+ <number>1</number>
+ </property>
+ <property name="margin">
+ <number>1</number>
+ </property>
+ <item>
+ <layout class="QVBoxLayout" name="verticalLayout_4">
+ <property name="spacing">
+ <number>0</number>
+ </property>
+ <property name="bottomMargin">
+ <number>1</number>
+ </property>
+ <item>
+ <widget class="QCheckBox" name="mCheckBoxShowAll">
+ <property name="text">
+ <string>Set all ROI visible</string>
+ </property>
+ <property name="checked">
+ <bool>false</bool>
+ </property>
+ <property name="tristate">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QCheckBox" name="mContourCheckBoxShowAll">
+ <property name="text">
+ <string>Set all contours visible</string>
+ </property>
+ <property name="checked">
+ <bool>false</bool>
+ </property>
+ <property name="tristate">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ </layout>
</widget>
</item>
</layout>
</item>
</layout>
- </item>
- <item>
- <layout class="QHBoxLayout" name="horizontalLayout_3">
- <item>
- <widget class="QLabel" name="mROInameLabel">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="text">
- <string>Name : Lung</string>
- </property>
- </widget>
- </item>
- <item>
- <spacer name="horizontalSpacer_5">
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>40</width>
- <height>20</height>
- </size>
- </property>
- </spacer>
- </item>
- <item>
- <widget class="QLabel" name="mROInameLabel_3">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="text">
- <string>Depth</string>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QSpinBox" name="mDepthSpinBox">
- <property name="minimum">
- <number>1</number>
- </property>
- <property name="maximum">
- <number>999999</number>
- </property>
- </widget>
- </item>
- </layout>
- </item>
- </layout>
- </widget>
- </item>
- <item>
- <widget class="QGroupBox" name="groupBox">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="title">
- <string>All ROI</string>
- </property>
- <layout class="QVBoxLayout" name="verticalLayout_2">
- <property name="spacing">
- <number>1</number>
- </property>
- <property name="margin">
- <number>1</number>
- </property>
- <item>
- <layout class="QVBoxLayout" name="verticalLayout_4">
- <property name="spacing">
- <number>0</number>
- </property>
- <property name="bottomMargin">
- <number>1</number>
- </property>
- <item>
- <widget class="QCheckBox" name="mCheckBoxShowAll">
- <property name="text">
- <string>Set all ROI visible</string>
- </property>
- <property name="checked">
- <bool>false</bool>
- </property>
- <property name="tristate">
- <bool>true</bool>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QCheckBox" name="mContourCheckBoxShowAll">
- <property name="text">
- <string>Set all contours visible</string>
- </property>
- <property name="checked">
- <bool>false</bool>
- </property>
- <property name="tristate">
- <bool>true</bool>
- </property>
- </widget>
- </item>
- </layout>
- </item>
- </layout>
- </widget>
+ </widget>
+ </item>
+ <item>
+ <layout class="QVBoxLayout" name="verticalLayout_3">
+ <item>
+ <widget class="QLabel" name="mROInameLabel_4">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Close tab</string>
+ </property>
+ <property name="alignment">
+ <set>Qt::AlignCenter</set>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QPushButton" name="mCloseButton">
+ <property name="toolTip">
+ <string/>
+ </property>
+ <property name="autoFillBackground">
+ <bool>false</bool>
+ </property>
+ <property name="text">
+ <string/>
+ </property>
+ <property name="icon">
+ <iconset resource="../vvIcons.qrc">
+ <normaloff>:/common/icons/exit.png</normaloff>:/common/icons/exit.png</iconset>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ </layout>
</item>
</layout>
</widget>
+ <tabstops>
+ <tabstop>mOpenBinaryButton</tabstop>
+ <tabstop>mBackgroundValueSpinBox</tabstop>
+ <tabstop>mBGModeCheckBox</tabstop>
+ <tabstop>mOpenDicomButton</tabstop>
+ <tabstop>mTree</tabstop>
+ <tabstop>mCheckBoxShow</tabstop>
+ <tabstop>mChangeColorButton</tabstop>
+ <tabstop>mReloadButton</tabstop>
+ <tabstop>mOpacitySlider</tabstop>
+ <tabstop>mOpacitySpinBox</tabstop>
+ <tabstop>mContourCheckBoxShow</tabstop>
+ <tabstop>mChangeContourColorButton</tabstop>
+ <tabstop>mContourWidthSpinBox</tabstop>
+ <tabstop>mDepthSpinBox</tabstop>
+ <tabstop>mCheckBoxShowAll</tabstop>
+ <tabstop>mContourCheckBoxShowAll</tabstop>
+ <tabstop>mCloseButton</tabstop>
+ </tabstops>
<resources>
<include location="../vvIcons.qrc"/>
</resources>
<slot>setValue(int)</slot>
<hints>
<hint type="sourcelabel">
- <x>219</x>
- <y>385</y>
+ <x>289</x>
+ <y>371</y>
</hint>
<hint type="destinationlabel">
- <x>376</x>
- <y>376</y>
+ <x>413</x>
+ <y>374</y>
</hint>
</hints>
</connection>
<y>367</y>
</hint>
<hint type="destinationlabel">
- <x>222</x>
- <y>373</y>
+ <x>292</x>
+ <y>371</y>
</hint>
</hints>
</connection>
void vvMeshActor::SetCutSlice(double slice)
{
- DD("SetCutSlice");
- DD(slice);
+ //DD("SetCutSlice");
+ //DD(slice);
mCutSlice=slice;
vtkImageData* mask;
if (static_cast<unsigned int>(mTimeSlice)<mMesh->GetNumberOfMasks())
// Create main action
if (mToolIconFilename == "noicon")
mAction = new QAction(QString("&").append(mToolMenuName), this);
- else
+ else {
mAction = new QAction(QIcon(mToolIconFilename),
QString("&").append(mToolMenuName), this);
+ mAction->setIconVisibleInMenu(true);
+ }
+
mAction->setStatusTip(mToolTip);
// Connect the action
connect(mAction, SIGNAL(triggered()), this, SLOT(MenuToolSlot()));
#include "vvROIActor.h"
#include "vvSlicer.h"
#include "vvROIActor.h"
+#include "vvMeshReader.h"
+#include "vvStructSelector.h"
// Qt
#include <QFileDialog>
//------------------------------------------------------------------------------
vvToolROIManager::vvToolROIManager(vvMainWindowBase * parent, Qt::WindowFlags f):
- // vvToolWidgetBase(parent, f),
- // if Qt::Widget -> No dialog in this case (in tab) ; PB = "invisible widget on menu" !
- // if "f" normal widget
- QWidget(parent->GetTab()->widget(4)),
+ QWidget(parent->GetTab()),
vvToolBase<vvToolROIManager>(parent),
Ui::vvToolROIManager()
{
- // Insert the current QWidget into the tab layout (required)
- QWidget * mother = qFindChild<QWidget*>(parent->GetTab(), "ROItab");
- mother->layout()->addWidget(this);
+ // Store parent
+ mMainWindow = parent;
+
+ // Assume the initial tab ROI index is 2
+ mIndexFirstTab = 2;
+
+ // Get the ROI Tab
+ QWidget * tab = qFindChild<QWidget*>(parent->GetTab(), "ROItab");
+
+ // Set it as current
+ parent->GetTab()->setCurrentIndex(mIndexFirstTab);
+
+ // Check if widget already used
+ if (tab->layout()->isEmpty()) {
+ tab->layout()->addWidget(this);
+ }
+ else {
+ close();
+ return;
+ }
// Build the UI
Ui_vvToolROIManager::setupUi(this);
setAttribute(Qt::WA_DeleteOnClose);
+ mTree->clear();
+ mTree->header()->resizeSection(0, 30);
+ mGroupBoxROI->setEnabled(false);
+
+ // Temporary disable "Load dicom" button
+ frame_4->hide();
+
+ // Set default LUT
+ mDefaultLUTColor = vtkSmartPointer<vtkLookupTable>::New();
+ for(int i=0; i<mDefaultLUTColor->GetNumberOfTableValues(); i++) {
+ double r = (rand()/(RAND_MAX+1.0));
+ double v = (rand()/(RAND_MAX+1.0));
+ double b = (rand()/(RAND_MAX+1.0));
+ mDefaultLUTColor->SetTableValue(i, r, v, b);
+ }
+#include "vvDefaultLut.h"
+
+ // Initialization
+ mNumberOfVisibleROI = 0;
+ mNumberOfVisibleContourROI = 0;
// Select the current image as the target
int i = parent->GetSlicerManagerCurrentIndex();
this, SLOT(AnImageIsBeingClosed(vvSlicerManager *)));
connect(parent, SIGNAL(SelectedImageHasChanged(vvSlicerManager *)),
this, SLOT(SelectedImageHasChanged(vvSlicerManager *)));
-
- // mMainWindowBase->GetTab()->setTabIcon(mTabNumber, GetToolIcon());
+ connect(mOpenBinaryButton, SIGNAL(clicked()), this, SLOT(OpenBinaryImage()));
+ connect(mOpenDicomButton, SIGNAL(clicked()), this, SLOT(OpenDicomImage()));
+ connect(mTree, SIGNAL(itemSelectionChanged()), this, SLOT(SelectedItemChangedInTree()));
+ connect(mCheckBoxShow, SIGNAL(toggled(bool)), this, SLOT(VisibleROIToggled(bool)));
+ connect(mOpacitySlider, SIGNAL(valueChanged(int)), this, SLOT(OpacityChanged(int)));
+ connect(mChangeColorButton, SIGNAL(clicked()), this, SLOT(ChangeColor()));
+ connect(mContourCheckBoxShow, SIGNAL(toggled(bool)), this, SLOT(VisibleContourROIToggled(bool)));
+ connect(mChangeContourColorButton, SIGNAL(clicked()), this, SLOT(ChangeContourColor()));
+ connect(mContourWidthSpinBox, SIGNAL(valueChanged(int)), this, SLOT(ChangeContourWidth(int)));
+ connect(mDepthSpinBox, SIGNAL(valueChanged(int)), this, SLOT(ChangeDepth(int)));
+ connect(mReloadButton, SIGNAL(clicked()), this, SLOT(ReloadCurrentROI()));
+ connect(mCheckBoxShowAll, SIGNAL(stateChanged(int)), this, SLOT(AllVisibleROIToggled(int)));
+ connect(mContourCheckBoxShowAll, SIGNAL(toggled(bool)), this, SLOT(AllVisibleContourROIToggled(bool)));
+ connect(mCloseButton, SIGNAL(clicked()), this, SLOT(close()));
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
vvToolROIManager::~vvToolROIManager()
{
- std::cout << "vvToolROIManager::~vvToolROIManager()" << std::endl;
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
void vvToolROIManager::InputIsSelected(vvSlicerManager *m)
{
- std::cout << "vvToolROIManager::InputIsSelected()" << std::endl;
mSlicerManager = m;
- // Signal/slot
- connect(mCloseButton, SIGNAL(clicked()), this, SLOT(close()));
-
// Initialization
+ mSlicerManager = m;
+ mCurrentImage = mSlicerManager->GetImage();
+
+ // Refuse if 4D
+ if (mCurrentImage->GetNumberOfDimensions() != 3) {
+ QMessageBox::information(this,tr("Sorry only 3D yet"), tr("Sorry only 3D yet"));
+ close();
+ return;
+ }
+ // Change gui
+ mLabelInputInfo->setText(QString("%1").arg(m->GetFileName().c_str()));
+
+ // Auto display browser to select new contours
+ OpenBinaryImage();
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
void vvToolROIManager::AnImageIsBeingClosed(vvSlicerManager * m)
{
- if (m == mSlicerManager) close();
+ if (m == mSlicerManager) {
+ close();
+ return;
+ }
+}
+//------------------------------------------------------------------------------
+
+
+//------------------------------------------------------------------------------
+void vvToolROIManager::close()
+{
+ // Update to delete actors
+ UpdateAllContours();
+ QWidget::close();
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
void vvToolROIManager::SelectedImageHasChanged(vvSlicerManager * m) {
- if (m != mSlicerManager) hide();
- else show();
+ if (m != mSlicerManager) hide();
+ else {
+ show();
+ }
+}
+//------------------------------------------------------------------------------
+
+
+//------------------------------------------------------------------------------
+void vvToolROIManager::OpenBinaryImage()
+{
+ // Open images
+ QString Extensions = "Images files ( *.mha *.mhd *.hdr *.his)";
+ Extensions += ";;All Files (*)";
+ QStringList filename =
+ QFileDialog::getOpenFileNames(this,tr("Open binary image"),
+ mMainWindowBase->GetInputPathName(),Extensions);
+ if (filename.size() == 0) return;
+
+ // For each selected file, open the image
+ for(int i=0; i<filename.size(); i++) {
+ // Open Image
+ QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
+ vvImageReader::Pointer reader = vvImageReader::New();
+ std::vector<std::string> filenames;
+ filenames.push_back(filename[i].toStdString());
+ reader->SetInputFilenames(filenames);
+ reader->Update(vvImageReader::IMAGE);
+ QApplication::restoreOverrideCursor();
+
+ if (reader->GetLastError().size() != 0) {
+ std::cerr << "Error while reading " << filename[i].toStdString() << std::endl;
+ QString error = "Cannot open file \n";
+ error += reader->GetLastError().c_str();
+ QMessageBox::information(this,tr("Reading problem"),error);
+ return;
+ }
+ vvImage::Pointer binaryImage = reader->GetOutput();
+ AddImage(binaryImage, filename[i].toStdString(), mBackgroundValueSpinBox->value(),
+ (!mBGModeCheckBox->isChecked()));
+ mOpenedBinaryImage.push_back(binaryImage);
+ }
+
+ // Update the contours
+ UpdateAllContours();
+}
+//------------------------------------------------------------------------------
+
+
+//------------------------------------------------------------------------------
+void vvToolROIManager::OpenDicomImage()
+{
+ DD("OpenDicomImage");
+ QString Extensions = "Dicom Files ( *.dcm RS*)";
+ Extensions += ";;All Files (*)";
+ QString file = QFileDialog::getOpenFileName(this,tr("Merge Images"),
+ mMainWindow->GetInputPathName(),
+ Extensions);
+ if (file.isNull()) return;
+
+ // AddDCStructContour(index, file);
+ vvMeshReader reader;
+ reader.SetFilename(file.toStdString());
+ vvStructSelector selector;
+ selector.SetStructures(reader.GetROINames());
+ // selector.EnablePropagationCheckBox(); FIXME Disable
+
+ // FIXME : change text -> allow to save binary image
+
+ if (selector.exec()) {
+ QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
+ reader.SetSelectedItems(selector.getSelectedItems());
+ reader.SetImage(mSlicerManager->GetImage());
+ reader.Update();
+
+ // std::vector<vvMesh::Pointer> contours=reader.GetOutput();
+ // for (std::vector<vvMesh::Pointer>::iterator i=contours.begin();
+ // i!=contours.end(); i++)
+ // AddContour(index,*i,selector.PropagationEnabled());
+ QApplication::restoreOverrideCursor();
+ }
+
+
+
+}
+//------------------------------------------------------------------------------
+
+
+//------------------------------------------------------------------------------
+void vvToolROIManager::AddImage(vvImage * binaryImage, std::string filename,
+ double BG, bool modeBG)
+{
+ // Check Dimension
+ int dim = mCurrentImage->GetNumberOfDimensions();
+ int bin_dim = binaryImage->GetNumberOfDimensions();
+ if (dim < bin_dim) {
+ std::ostringstream os;
+ os << "Error. Loaded binary image is " << bin_dim
+ << "D while selected image is " << dim << "D" << std::endl;
+ QMessageBox::information(this,tr("Reading problem"),os.str().c_str());
+ return;
+ }
+
+ // Compute roi index
+ int n = mROIList.size();
+
+ // Compute the name of the new ROI
+ std::ostringstream oss;
+ oss << vtksys::SystemTools::GetFilenameName(vtksys::SystemTools::GetFilenameWithoutLastExtension(filename));
+ std::string name = oss.str();
+
+ // Set color
+ std::vector<double> color;
+ color.push_back(1);
+ color.push_back(0);
+ color.push_back(0);
+
+ // Create ROI
+ clitk::DicomRT_ROI::Pointer roi = clitk::DicomRT_ROI::New();
+ roi->SetFromBinaryImage(binaryImage, n, name, color, filename);
+
+ // Add a new roi to the list
+ mROIList.push_back(roi);
+
+ // Set BG or FG mode
+ if (modeBG)
+ roi->SetBackgroundValueLabelImage(BG);
+ else
+ roi->SetForegroundValueLabelImage(BG);
+
+ // Change color
+ if (n<mDefaultLUTColor->GetNumberOfTableValues ()) {
+ double * color = mDefaultLUTColor->GetTableValue(n % mDefaultLUTColor->GetNumberOfTableValues ());
+ roi->SetDisplayColor(color[0], color[1], color[2]);
+ }
+
+ // Add a new roi actor
+ QSharedPointer<vvROIActor> actor = QSharedPointer<vvROIActor>(new vvROIActor);
+ actor->SetBGMode(modeBG);
+ actor->SetROI(roi);
+ actor->SetSlicerManager(mSlicerManager);
+ actor->Initialize(n+1); // depth is n+1 to start at 1
+ mROIActorsList.push_back(actor);
+
+ // CheckBox for "All"
+ if (actor->IsVisible()) mNumberOfVisibleROI++;
+ if (actor->IsContourVisible()) mNumberOfVisibleContourROI++;
+
+ // Add ROI in tree
+ mTreeWidgetList.push_back(QSharedPointer<QTreeWidgetItem>(new QTreeWidgetItem(mTree)));
+ QTreeWidgetItem * w = mTreeWidgetList.back().data();
+ w->setText(0, QString("%1").arg(roi->GetROINumber()));
+ w->setText(1, QString("%1").arg(roi->GetName().c_str()));
+ w->setText(3, QString("%1").arg(actor->GetDepth()));
+ QBrush brush(QColor(roi->GetDisplayColor()[0]*255,
+ roi->GetDisplayColor()[1]*255,
+ roi->GetDisplayColor()[2]*255));
+ brush.setStyle(Qt::SolidPattern);
+ w->setBackground(2, brush);
+ mMapROIToTreeWidget[roi] = w;
+ mMapTreeWidgetToROI[w] = roi;
+ mTree->resizeColumnToContents(0);
+ mTree->resizeColumnToContents(1);
+
+ // Update
+ UpdateAllROIStatus();
+}
+//------------------------------------------------------------------------------
+
+
+//------------------------------------------------------------------------------
+void vvToolROIManager::UpdateAllContours()
+{
+ // Render loaded ROIs (the first is sufficient)
+ for(unsigned int i=0; i<mROIList.size(); i++) {
+ mROIActorsList[i]->Update();
+ }
+ for(int i=0; i<mSlicerManager->GetNumberOfSlicers(); i++) {
+ mSlicerManager->GetSlicer(i)->Render();
+ }
+}
+//------------------------------------------------------------------------------
+
+
+//------------------------------------------------------------------------------
+void vvToolROIManager::UpdateAllROIStatus() {
+ int nbVisible = 0;
+ int nb = mROIList.size();
+ for(int i=0; i<nb; i++) {
+ if (mROIActorsList[i]->IsVisible()) {
+ nbVisible++;
+ }
+ }
+
+ // change the states
+ disconnect(mCheckBoxShowAll, SIGNAL(stateChanged(int)), this, SLOT(AllVisibleROIToggled(int)));
+ disconnect(mContourCheckBoxShowAll, SIGNAL(toggled(bool)), this, SLOT(AllVisibleContourROIToggled(bool)));
+ if (nbVisible == nb) mCheckBoxShowAll->setCheckState(Qt::Checked);
+ else {
+ if (nbVisible == 0) mCheckBoxShowAll->setCheckState(Qt::Unchecked);
+ else mCheckBoxShowAll->setCheckState(Qt::PartiallyChecked);
+ }
+ connect(mContourCheckBoxShowAll, SIGNAL(toggled(bool)), this, SLOT(AllVisibleContourROIToggled(bool)));
+ connect(mCheckBoxShowAll, SIGNAL(stateChanged(int)), this, SLOT(AllVisibleROIToggled(int)));
+}
+//------------------------------------------------------------------------------
+
+
+//------------------------------------------------------------------------------
+void vvToolROIManager::SelectedItemChangedInTree() {
+ // Search which roi is selected
+ QList<QTreeWidgetItem *> l = mTree->selectedItems();
+ if (l.size() == 0) {
+ // mCurrentROIActor = 0;
+ mCurrentROI = NULL;
+ mGroupBoxROI->setEnabled(false);
+ return;
+ }
+ QTreeWidgetItem * w = l[0];
+ if (mMapTreeWidgetToROI.find(w) == mMapTreeWidgetToROI.end()) {
+ // mCurrentROIActor = 0;
+ mCurrentROI = NULL;
+ mGroupBoxROI->setEnabled(false);
+ return;
+ }
+ if (w == NULL) return;
+ clitk::DicomRT_ROI * roi = mMapTreeWidgetToROI[w];
+ if (roi == NULL) return; // sometimes it is called while there is no roi anymore
+ // Get selected roi actor
+ int n = roi->GetROINumber();
+ QSharedPointer<vvROIActor> actor = mROIActorsList[n];
+ mCurrentROI = roi;
+ mCurrentROIActor = actor;
+
+ // Warning -> avoid unuseful Render here by disconnect slider
+ // Update GUI
+ disconnect(mTree, SIGNAL(itemSelectionChanged()), this, SLOT(SelectedItemChangedInTree()));
+ disconnect(mCheckBoxShow, SIGNAL(toggled(bool)), this, SLOT(VisibleROIToggled(bool)));
+ disconnect(mOpacitySlider, SIGNAL(valueChanged(int)), this, SLOT(OpacityChanged(int)));
+ disconnect(mChangeColorButton, SIGNAL(clicked()), this, SLOT(ChangeColor()));
+ disconnect(mContourCheckBoxShow, SIGNAL(toggled(bool)), this, SLOT(VisibleContourROIToggled(bool)));
+ disconnect(mChangeContourColorButton, SIGNAL(clicked()), this, SLOT(ChangeContourColor()));
+ disconnect(mContourWidthSpinBox, SIGNAL(valueChanged(int)), this, SLOT(ChangeContourWidth(int)));
+ disconnect(mDepthSpinBox, SIGNAL(valueChanged(int)), this, SLOT(ChangeDepth(int)));
+
+ mGroupBoxROI->setEnabled(true);
+ mROInameLabel->setText(roi->GetName().c_str());
+ mCheckBoxShow->setChecked(actor->IsVisible());
+ mContourCheckBoxShow->setChecked(actor->IsContourVisible());
+ mContourWidthSpinBox->setValue(actor->GetContourWidth());
+ mDepthSpinBox->setValue(actor->GetDepth());
+ w->setText(3, QString("%1").arg(actor->GetDepth()));
+ mOpacitySlider->setValue((int)lrint(actor->GetOpacity()*100));
+ mOpacitySpinBox->setValue((int)lrint(actor->GetOpacity()*100));
+
+ connect(mTree, SIGNAL(itemSelectionChanged()), this, SLOT(SelectedItemChangedInTree()));
+ connect(mCheckBoxShow, SIGNAL(toggled(bool)), this, SLOT(VisibleROIToggled(bool)));
+ connect(mOpacitySlider, SIGNAL(valueChanged(int)), this, SLOT(OpacityChanged(int)));
+ connect(mChangeColorButton, SIGNAL(clicked()), this, SLOT(ChangeColor()));
+ connect(mContourCheckBoxShow, SIGNAL(toggled(bool)), this, SLOT(VisibleContourROIToggled(bool)));
+ connect(mChangeContourColorButton, SIGNAL(clicked()), this, SLOT(ChangeContourColor()));
+ connect(mContourWidthSpinBox, SIGNAL(valueChanged(int)), this, SLOT(ChangeContourWidth(int)));
+ connect(mDepthSpinBox, SIGNAL(valueChanged(int)), this, SLOT(ChangeDepth(int)));
+
+
+ // Set the current color to the selected ROI name
+ mROInameLabel->setAutoFillBackground(true);// # This is important!!
+ mROInameLabel->setStyleSheet("QLabel { background-color : red; color : blue; }");
+ QColor color = QColor(mCurrentROI->GetDisplayColor()[0]*255,
+ mCurrentROI->GetDisplayColor()[1]*255,
+ mCurrentROI->GetDisplayColor()[2]*255);
+ QString values = QString("%1, %2, %3").arg(color.red()).arg(color.green()).arg(color.blue());
+ mROInameLabel->setStyleSheet("QLabel { background-color: rgb("+values+"); }");
+
+
+ mGroupBoxROI->setEnabled(true);
+ // is this needed ?
+ // actor->Update();
+ // Final rendering
+ // mCurrentSlicerManager->Render();
+}
+//------------------------------------------------------------------------------
+
+
+//------------------------------------------------------------------------------
+void vvToolROIManager::VisibleROIToggled(bool b) {
+ if (mCurrentROIActor == NULL) return;
+ if (b == mCurrentROIActor->IsVisible()) return; // nothing to do
+ mCurrentROIActor->SetVisible(b);
+ UpdateAllROIStatus();
+ mSlicerManager->Render();
+}
+//------------------------------------------------------------------------------
+
+
+//------------------------------------------------------------------------------
+void vvToolROIManager::VisibleContourROIToggled(bool b) {
+ if (mCurrentROIActor == NULL) return;
+ if (mCurrentROIActor->IsContourVisible() == b) return; // nothing to do
+ mCurrentROIActor->SetContourVisible(b);
+ mCurrentROIActor->UpdateColor();
+ mSlicerManager->Render();
+}
+//------------------------------------------------------------------------------
+
+
+//------------------------------------------------------------------------------
+void vvToolROIManager::OpacityChanged(int v) {
+ if (mCurrentROIActor == NULL) return;
+ mCurrentROIActor->SetOpacity((double)v/100.0);
+ mCurrentROIActor->UpdateColor();
+ mSlicerManager->Render();
+}
+//------------------------------------------------------------------------------
+
+
+//------------------------------------------------------------------------------
+void vvToolROIManager::AllVisibleROIToggled(int b) {
+ bool status = false;
+ if ((mCheckBoxShowAll->checkState() == Qt::Checked) ||
+ (mCheckBoxShowAll->checkState() == Qt::PartiallyChecked)) status = true;
+
+ for(uint i=0; i<mROIList.size(); i++) {
+ mROIActorsList[i]->SetVisible(status);
+ }
+ if (status) mCheckBoxShowAll->setCheckState(Qt::Checked);
+ else mCheckBoxShowAll->setCheckState(Qt::Unchecked);
+ mCheckBoxShow->setChecked(status);
+ mSlicerManager->Render();
+}
+//------------------------------------------------------------------------------
+
+
+//------------------------------------------------------------------------------
+void vvToolROIManager::AllVisibleContourROIToggled(bool b) {
+ bool status = false;
+ if ((mContourCheckBoxShowAll->checkState() == Qt::Checked) ||
+ (mContourCheckBoxShowAll->checkState() == Qt::PartiallyChecked)) status = true;
+ // Update current
+ for(uint i=0; i<mROIActorsList.size(); i++) {
+ mROIActorsList[i]->SetContourVisible(status);
+ }
+ // Update current selection
+ if (status) mContourCheckBoxShowAll->setCheckState(Qt::Checked);
+ else mContourCheckBoxShowAll->setCheckState(Qt::Unchecked);
+ mContourCheckBoxShow->setChecked(status);
+ mSlicerManager->Render();
+}
+//------------------------------------------------------------------------------
+
+
+//------------------------------------------------------------------------------
+void vvToolROIManager::ChangeColor() {
+ if (mCurrentROIActor == NULL) return;
+ QColor color;
+ color.setRgbF(mCurrentROIActor->GetROI()->GetDisplayColor()[0],
+ mCurrentROIActor->GetROI()->GetDisplayColor()[1],
+ mCurrentROIActor->GetROI()->GetDisplayColor()[2]);
+ QColor c = QColorDialog::getColor(color, this, "Choose the ROI color");
+ mCurrentROIActor->GetROI()->SetDisplayColor(c.redF(), c.greenF(), c.blueF());
+ mCurrentROIActor->UpdateColor();
+
+ QTreeWidgetItem * w = mMapROIToTreeWidget[mCurrentROI];
+ QBrush brush(QColor(mCurrentROI->GetDisplayColor()[0]*255,
+ mCurrentROI->GetDisplayColor()[1]*255,
+ mCurrentROI->GetDisplayColor()[2]*255));
+ brush.setStyle(Qt::SolidPattern);
+ w->setBackground(2, brush);
+ // Render
+ mSlicerManager->Render();
+}
+//------------------------------------------------------------------------------
+
+
+//------------------------------------------------------------------------------
+void vvToolROIManager::ChangeContourColor() {
+ if (mCurrentROIActor == NULL) return;
+ QColor color;
+ color.setRgbF(mCurrentROIActor->GetContourColor()[0],
+ mCurrentROIActor->GetContourColor()[1],
+ mCurrentROIActor->GetContourColor()[2]);
+ QColor c = QColorDialog::getColor(color, this, "Choose the contour color");
+ mCurrentROIActor->SetContourColor(c.redF(), c.greenF(), c.blueF());
+ mCurrentROIActor->UpdateColor();
+ mSlicerManager->Render();
+}
+//------------------------------------------------------------------------------
+
+
+//------------------------------------------------------------------------------
+void vvToolROIManager::ChangeContourWidth(int n) {
+ if (mCurrentROIActor == NULL) return;
+ mCurrentROIActor->SetContourWidth(n);
+ mCurrentROIActor->UpdateColor();
+ mSlicerManager->Render();
+}
+//------------------------------------------------------------------------------
+
+
+//------------------------------------------------------------------------------
+void vvToolROIManager::ChangeDepth(int n) {
+ if (mCurrentROIActor == NULL) return;
+ mCurrentROIActor->SetDepth(n);
+ mCurrentROIActor->UpdateImage();
+ mSlicerManager->Render();
+ QList<QTreeWidgetItem *> l = mTree->selectedItems();
+ QTreeWidgetItem * w = l[0];
+ w->setText(3, QString("%1").arg(mCurrentROIActor->GetDepth()));
+}
+//------------------------------------------------------------------------------
+
+
+//------------------------------------------------------------------------------
+void vvToolROIManager::ReloadCurrentROI() {
+
+ // Remove all contours/overlay first
+ bool visible = mCurrentROIActor->IsVisible();
+ bool cvisible = mCurrentROIActor->IsContourVisible();
+ mCurrentROIActor->SetVisible(false);
+ mCurrentROIActor->SetContourVisible(false);
+ mSlicerManager->Render();
+
+ // Reload image
+ vvImageReader::Pointer reader = vvImageReader::New();
+ reader->SetInputFilename(mCurrentROI->GetFilename());
+ reader->Update(vvImageReader::IMAGE);
+ if (reader->GetLastError() != "") {
+ QMessageBox::information(mMainWindowBase, tr("Sorry, error. Could not reload"),
+ reader->GetLastError().c_str());
+ return;
+ }
+
+ mCurrentROI->GetImage()->Reset();//GetFirstVTKImageData()->ReleaseData();
+ mCurrentROI->SetImage(reader->GetOutput());
+
+ // Update visu
+ mCurrentROIActor->UpdateImage();
+ mCurrentROIActor->SetVisible(visible);
+ mCurrentROIActor->SetContourVisible(cvisible);
+ mSlicerManager->Render();
}
//------------------------------------------------------------------------------
static void Initialize();
virtual void InputIsSelected(vvSlicerManager *m);
+ void AddImage(vvImage * binaryImage, std::string filename, double BG, bool m_modeBG=true);
+ void UpdateAllContours();
+ void UpdateAllROIStatus();
+
public slots:
void AnImageIsBeingClosed(vvSlicerManager *);
void SelectedImageHasChanged(vvSlicerManager *);
+ void OpenBinaryImage();
+ void OpenDicomImage();
+ void SelectedItemChangedInTree();
+ void VisibleROIToggled(bool b);
+ void VisibleContourROIToggled(bool b);
+ void OpacityChanged(int v);
+ void ChangeColor();
+ void ChangeContourColor();
+ void ChangeContourWidth(int n);
+ void ChangeDepth(int n);
+ void AllVisibleROIToggled(int b);
+ void AllVisibleContourROIToggled(bool b);
+ void ReloadCurrentROI();
+ void close();
protected:
Ui::vvToolROIManager ui;
vvSlicerManager * mSlicerManager;
+ vvImage * mCurrentImage;
+ vvMainWindowBase * mMainWindow;
+ int mIndexFirstTab;
+
+ int mNumberOfVisibleROI;
+ int mNumberOfVisibleContourROI;
+
+ vtkSmartPointer<vtkLookupTable> mDefaultLUTColor;
+
+ std::vector<vvImage::Pointer> mOpenedBinaryImage;
+ std::vector<clitk::DicomRT_ROI::Pointer> mROIList;
+ std::vector<QSharedPointer<vvROIActor> > mROIActorsList;
+
+ // Data for the widget Tree
+ std::vector< QSharedPointer<QTreeWidgetItem> > mTreeWidgetList;
+ std::map<clitk::DicomRT_ROI::Pointer, QTreeWidgetItem *> mMapROIToTreeWidget;
+ std::map<QTreeWidgetItem *, clitk::DicomRT_ROI::Pointer> mMapTreeWidgetToROI;
+
+ // Data for current selected roi
+ clitk::DicomRT_ROI::Pointer mCurrentROI;
+ QSharedPointer<vvROIActor> mCurrentROIActor;
}; // end class vvToolROIManager
//------------------------------------------------------------------------------