set(CLITK_SOURCE_DIR ${PROJECT_SOURCE_DIR})
endif(NOT DEFINED CLITK_SOURCE_DIR)
#=========================================================
-
+SET(QT_MIN_VERSION "5.0.0")
+SET(VTK_MIN_VERSION "6.0.0")
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
if(MSVC)
//------------------------------------------------------------------------------
vvBinaryImageOverlayActor::vvBinaryImageOverlayActor()
-{ //out << __func__ << endl;
+{
mTSlice = -1;
mSlice = 0;
mColor.resize(3);
//------------------------------------------------------------------------------
vvBinaryImageOverlayActor::~vvBinaryImageOverlayActor()
-{ //out << __func__ << endl;
+{
mImageActorList.clear();
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
void vvBinaryImageOverlayActor::RemoveActors()
-{ //out << __func__ << endl;
+{
for (unsigned int i = 0; i < mImageActorList.size(); i++) {
if (mSlicer != 0) {
if (mSlicer != NULL) {
//------------------------------------------------------------------------------
void vvBinaryImageOverlayActor::SetColor(double r, double g, double b)
-{ //out << __func__ << endl;
+{
mColor[0] = r;
mColor[1] = g;
mColor[2] = b;
//------------------------------------------------------------------------------
void vvBinaryImageOverlayActor::SetSlicer(vvSlicer * slicer)
-{ //out << __func__ << endl;
+{
mSlicer = slicer;
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
void vvBinaryImageOverlayActor::Initialize(bool IsVisible)
-{ //out << __func__ << endl;
+{
if (!mSlicer) {
std::cerr << "ERROR. Please use setSlicer before setSlicer in vvBinaryImageOverlayActor." << std::endl;
exit(0);
//------------------------------------------------------------------------------
void vvBinaryImageOverlayActor::SetOpacity(double d)
-{ //out << __func__ << endl;
+{
mAlpha = d;
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
void vvBinaryImageOverlayActor::SetImage(vvImage::Pointer image, double bg, bool modeBG)
-{ //out << __func__ << endl;
+{
mImage = image;
if (modeBG) {
mBackgroundValue = bg;
//------------------------------------------------------------------------------
void vvBinaryImageOverlayActor::HideActors()
-{ //out << __func__ << endl;
+{
if (!mSlicer) return;
mSlice = mSlicer->GetSlice();
for(unsigned int i=0; i<mImageActorList.size(); i++) {
//------------------------------------------------------------------------------
void vvBinaryImageOverlayActor::ShowActors()
-{ //out << __func__ << endl;
+{
if (!mSlicer) return;
mSlice = mSlicer->GetSlice();
mTSlice = mSlicer->GetTSlice();
//------------------------------------------------------------------------------
void vvBinaryImageOverlayActor::UpdateColor()
-{ //out << __func__ << endl;
+{
mColorLUT->SetTableValue(1, mColor[0], mColor[1], mColor[2], mAlpha); // FG
for (unsigned int numImage = 0; numImage < mSlicer->GetImage()->GetVTKImages().size(); numImage++) {
// how many intensity ?
//------------------------------------------------------------------------------
void vvBinaryImageOverlayActor::UpdateSlice(int slicer, int slice, bool force)
-{ //out << __func__ << endl;
+{
if (!mSlicer) return;
if (!force) {
int slice,
int * inExtent,
int * outExtent)
-{ //out << __func__ << endl;
+{
switch (orientation) {
case vtkImageViewer2::SLICE_ORIENTATION_XY:
for(int i=0; i<4; i++) outExtent[i] = inExtent[i];
//----------------------------------------------------------------------------
void vvBinaryImageOverlayActor::ComputeExtent(int * inExtent, int * outExtent, vtkImageData * image, vtkImageData * overlay)
-{ //out << __func__ << endl;
+{
for(int i=0; i<3; i++) {
double a = (image->GetOrigin()[i] + inExtent[i*2]*image->GetSpacing()[i] -
overlay->GetOrigin()[i]) / overlay->GetSpacing()[i];
int * extent,
vtkImageActor * actor,
double position)
-{ //out << __func__ << endl;
+{
/* FIXME
Error according to camera orientation
*/
//------------------------------------------------------------------------------
vvImageContour::vvImageContour()
-{ //out << __func__ << endl;
+{
mTSlice = -1;
mSlice = 0;
mHiddenImageIsUsed = false;
//------------------------------------------------------------------------------
vvImageContour::~vvImageContour()
-{ //out << __func__ << endl;
+{
mSquaresActorList.clear();
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
void vvImageContour::RemoveActors()
-{ //out << __func__ << endl;
+{
for (unsigned int i = 0; i < mSquaresActorList.size(); i++) {
if (mSlicer != 0) {
if (mSlicer!= NULL) {
//------------------------------------------------------------------------------
void vvImageContour::SetSlicer(vvSlicer * slicer)
-{ //out << __func__ << endl;
+{
mSlicer = slicer;
// Create an actor for each time slice
for (unsigned int numImage = 0; numImage < mSlicer->GetImage()->GetVTKImages().size(); numImage++) {
//------------------------------------------------------------------------------
void vvImageContour::SetImage(vvImage::Pointer image)
-{ //out << __func__ << endl;
+{
for (unsigned int numImage = 0; numImage < image->GetVTKImages().size(); numImage++) {
#if VTK_MAJOR_VERSION <= 5
mClipperList[numImage]->SetInput(image->GetVTKImages()[numImage]);
//------------------------------------------------------------------------------
void vvImageContour::SetPreserveMemoryModeEnabled(bool b)
-{ //out << __func__ << endl;
+{
// FastCache mode work only if threshold is always the same
if (mDisplayModeIsPreserveMemory == b) return;
mDisplayModeIsPreserveMemory = b;
//------------------------------------------------------------------------------
void vvImageContour::SetColor(double r, double g, double b)
-{ //out << __func__ << endl;
+{
for(unsigned int i=0; i<mSquaresActorList.size(); i++) {
mSquaresActorList[i]->GetProperty()->SetColor(r,g,b);
mSquaresActorList[i]->GetProperty()->SetOpacity(0.995);
//------------------------------------------------------------------------------
void vvImageContour::SetLineWidth(double w)
-{ //out << __func__ << endl;
+{
for(unsigned int i=0; i<mSquaresActorList.size(); i++) {
mSquaresActorList[i]->GetProperty()->SetLineWidth(w);
}
//------------------------------------------------------------------------------
void vvImageContour::HideActors()
-{ //out << __func__ << endl;
+{
if (!mSlicer) return;
mSlice = mSlicer->GetSlice();
for(unsigned int i=0; i<mSquaresActorList.size(); i++) {
//------------------------------------------------------------------------------
void vvImageContour::ShowActors()
-{ //out << __func__ << endl;
+{
if (!mSlicer) return;
mSlice = mSlicer->GetSlice();
mTSlice = mSlicer->GetTSlice();
//------------------------------------------------------------------------------
void vvImageContour::SetDepth(double d)
-{ //out << __func__ << endl;
+{
mDepth = d;
// Move the actor to be visible
double position[3] = {0, 0, 0};
//------------------------------------------------------------------------------
void vvImageContour::Update(double value)
-{ //out << __func__ << endl;
+{
if (!mSlicer) return;
if (mPreviousValue == value) {
if (mPreviousSlice == mSlicer->GetSlice()) {
//------------------------------------------------------------------------------
void vvImageContour::UpdateWithPreserveMemoryMode()
-{ //out << __func__ << endl;
+{
// Only change actor visibility if tslice change
mPreviousTslice = mTSlice;
mTSlice = mSlicer->GetTSlice();
//------------------------------------------------------------------------------
void vvImageContour::InitializeCacheMode()
-{ //out << __func__ << endl;
+{
clitkExceptionMacro("TODO : not implemented yet");
mPreviousSlice = mPreviousOrientation = 0;
int dim = mSlicer->GetImage()->GetNumberOfDimensions();
//------------------------------------------------------------------------------
int vvImageContour::ComputeCurrentOrientation()
-{ //out << __func__ << endl;
+{
// Get extent of image in the slicer
int* extent = mSlicer->GetImageActor()->GetDisplayExtent();
//------------------------------------------------------------------------------
void vvImageContour::UpdateWithFastCacheMode()
-{ //out << __func__ << endl;
+{
clitkExceptionMacro("TODO : not implemented yet");
// Compute orientation
//------------------------------------------------------------------------------
void vvImageContour::CreateNewActor(int numImage)
-{ //out << __func__ << endl;
+{
vtkSmartPointer<vtkActor> squaresActor = vtkSmartPointer<vtkActor>::New();
vtkSmartPointer<vtkImageClip> clipper = vtkSmartPointer<vtkImageClip>::New();
vtkSmartPointer<vtkMarchingSquares> squares = vtkSmartPointer<vtkMarchingSquares>::New();
vtkMarchingSquares * squares,
vtkImageClip * clipper,
double threshold, int orientation, int slice)
-{ //out << __func__ << endl;
+{
// Set parameter for the MarchigSquare
squares->SetValue(0, threshold);
squares->Update();
//------------------------------------------------------------------------------
vvMainWindow::vvMainWindow():vvMainWindowBase()
-{ //out << __func__ << endl;
+{
setupUi(this); // this sets up the GUI
mInputPathName = "";
}
//------------------------------------------------------------------------------
void vvMainWindow::show()
-{ //out << __func__ << endl;
+{
vvMainWindowBase::show();
PopupRegisterForm(true);
}
//------------------------------------------------------------------------------
void vvMainWindow::UpdateMemoryUsage()
-{ //out << __func__ << endl;
+{
// clitk::PrintMemory(true);
if (clitk::GetMemoryUsageInMb() == 0) infoPanel->setMemoryInMb("NA");
else infoPanel->setMemoryInMb(QString::number(clitk::GetMemoryUsageInMb())+" MiB");
//------------------------------------------------------------------------------
void vvMainWindow::createRecentlyOpenedFilesMenu()
-{ //out << __func__ << endl;
+{
recentlyOpenedFilesMenu = new QMenu("Recently opened files...");
recentlyOpenedFilesMenu->setIcon(QIcon(QString::fromUtf8(":/common/icons/open.png")));
menuFile->insertMenu(actionOpen_Image_With_Time,recentlyOpenedFilesMenu);
//------------------------------------------------------------------------------
void vvMainWindow::updateRecentlyOpenedFilesMenu(const std::list<std::string> &recent_files)
-{ //out << __func__ << endl;
+{
if(recentlyOpenedFilesMenu==NULL) {
createRecentlyOpenedFilesMenu();
} else {
//------------------------------------------------------------------------------
void vvMainWindow::ComputeMidPosition()
-{ //out << __func__ << endl;
+{
bool ok;
int index=GetSlicerIndexFromItem(DataTree->selectedItems()[0]);
int ref = QInputDialog::getInt(this,"Chose reference phase","Reference phase",0,0,\
//------------------------------------------------------------------------------
void vvMainWindow::AddContour(int image_index, vvMesh::Pointer contour, bool propagation)
-{ //out << __func__ << endl;
+{
QTreeWidgetItem *item = new QTreeWidgetItem();
item->setData(0,Qt::UserRole,"filename.vtk");
item->setData(1,Qt::UserRole,tr("contour"));
//------------------------------------------------------------------------------
void vvMainWindow::OpenVTKContour()
-{ //out << __func__ << endl;
+{
if (mSlicerManagers.size() > 0) {
QString Extensions = "Images ( *.vtk *.obj)";
Extensions += ";;All Files (*)";
//------------------------------------------------------------------------------
void vvMainWindow::AddDCStructContour(int index, QString file)
-{ //out << __func__ << endl;
+{
vvMeshReader reader;
reader.SetFilename(file.toStdString());
vvStructSelector selector;
//------------------------------------------------------------------------------
void vvMainWindow::OpenDCStructContour()
-{ //out << __func__ << endl;
+{
if (mSlicerManagers.size() > 0) {
QString Extensions = "Dicom Files ( *.dcm RS*)";
Extensions += ";;All Files (*)";
//------------------------------------------------------------------------------
void vvMainWindow::ComputeDeformableRegistration()
-{ //out << __func__ << endl;
+{
if (mSlicerManagers.size() > 0) {
int index = GetSlicerIndexFromItem(DataTree->selectedItems()[0]);
vvDeformationDialog dialog(index,mSlicerManagers);
//------------------------------------------------------------------------------
void vvMainWindow::WarpImage()
-{ //out << __func__ << endl;
+{
int index = GetSlicerIndexFromItem(DataTree->selectedItems()[0]);
if (!mSlicerManagers[index]->GetVF().IsNull()) {
bool ok;
//------------------------------------------------------------------------------
void vvMainWindow::WarpImage(vvSlicerManager* selected_slicer,int reference_phase)
-{ //out << __func__ << endl;
+{
if (!selected_slicer->GetVF().IsNull()) {
QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
QFileInfo info(selected_slicer->GetFileName().c_str());
//------------------------------------------------------------------------------
vvMainWindow::~vvMainWindow()
-{ //out << __func__ << endl;
+{
for (unsigned int i = 0; i < mSlicerManagers.size(); i++) {
if (mSlicerManagers[i] != NULL)
delete mSlicerManagers[i];
//------------------------------------------------------------------------------
QTabWidget * vvMainWindow::GetTab()
-{ //out << __func__ << endl;
+{
return tabWidget;
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
void vvMainWindow::MergeImages()
-{ //out << __func__ << endl;
+{
QString Extensions = EXTENSIONS;
Extensions += ";;All Files (*)";
QStringList files = QFileDialog::getOpenFileNames(this,tr("Merge Images"),mInputPathName,Extensions);
//------------------------------------------------------------------------------
void vvMainWindow::SliceImages()
-{ //out << __func__ << endl;
+{
QString Extensions = EXTENSIONS;
Extensions += ";;All Files (*)";
//------------------------------------------------------------------------------
void vvMainWindow::MergeImagesWithTime()
-{ //out << __func__ << endl;
+{
QString Extensions = EXTENSIONS;
Extensions += ";;All Files (*)";
QStringList files = QFileDialog::getOpenFileNames(this,tr("Merge Images With Time"),mInputPathName,Extensions);
//------------------------------------------------------------------------------
void vvMainWindow::OpenDicom()
-{ //out << __func__ << endl;
+{
std::vector<std::string> files;
//std::cout << "dicomSeriesSelector " << std::endl;
//------------------------------------------------------------------------------
void vvMainWindow::OpenImages()
-{ //out << __func__ << endl;
+{
QString Extensions = EXTENSIONS;
Extensions += ";;All Files (*)";
}
//------------------------------------------------------------------------------
void vvMainWindow::OpenRecentImage()
-{ //out << __func__ << endl;
+{
QAction * caller = qobject_cast<QAction*>(sender());
std::vector<std::string> images;
images.push_back(caller->text().toStdString());
//------------------------------------------------------------------------------
void vvMainWindow::OpenImageWithTime()
-{ //out << __func__ << endl;
+{
QString Extensions = EXTENSIONS;
Extensions += ";;All Files (*)";
//------------------------------------------------------------------------------
void vvMainWindow::LoadImages(std::vector<std::string> files, vvImageReader::LoadedImageType filetype)
-{ //out << __func__ << endl;
+{
//Separate the way to open images and dicoms
int fileSize;
if (filetype == vvImageReader::IMAGE || filetype == vvImageReader::IMAGEWITHTIME)
//------------------------------------------------------------------------------
void vvMainWindow::UpdateTree()
-{ //out << __func__ << endl;
+{
DataTree->resizeColumnToContents(COLUMN_TREE);
DataTree->resizeColumnToContents(COLUMN_UL_VIEW);
DataTree->resizeColumnToContents(COLUMN_UR_VIEW);
//------------------------------------------------------------------------------
void vvMainWindow::CurrentImageChanged(std::string id)
-{ //out << __func__ << endl;
+{
if (id == mCurrentSelectedImageId) return; // Do nothing
int selected = 0;
for (int i = 0; i < DataTree->topLevelItemCount(); i++) {
//------------------------------------------------------------------------------
void vvMainWindow::CurrentPickedImageChanged(std::string id)
-{ //out << __func__ << endl;
+{
if (id == mCurrentPickedImageId) return; // Do nothing
int selected = 0;
for (int i = 0; i < DataTree->topLevelItemCount(); i++) {
//------------------------------------------------------------------------------
void vvMainWindow::ImageInfoChanged()
-{ //out << __func__ << endl;
+{
contextActions[6]->setEnabled(1);
contextActions[5]->setEnabled(1);
actionSave_As->setEnabled(1);
//------------------------------------------------------------------------------
void vvMainWindow::ShowDocumentation()
-{ //out << __func__ << endl;
+{
documentation->show();
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
void vvMainWindow::PopupRegisterForm(bool checkCanPush)
-{ //out << __func__ << endl;
+{
vvRegisterForm* registerForm = new vvRegisterForm(QUrl("http://www.creatis.insa-lyon.fr/~dsarrut/vvregister/write.php"), getVVSettingsPath(), getSettingsOptionFormat());
if(!checkCanPush) {
registerForm->show();
//------------------------------------------------------------------------------
void vvMainWindow::ShowHelpDialog()
-{ //out << __func__ << endl;
+{
help_dialog->show();
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
void vvMainWindow::ChangeViewMode()
-{ //out << __func__ << endl;
+{
typedef struct _SIZE{
QSplitter* splitter;
QList<int> size1, size2;
//------------------------------------------------------------------------------
QString vvMainWindow::GetSizeInBytes(unsigned long size)
-{ //out << __func__ << endl;
+{
QString result = "";// QString::number(size);
//result += " bytes (";
if (size > 1000000000) {
//------------------------------------------------------------------------------
QString vvMainWindow::GetVectorDoubleAsString(std::vector<double> vectorDouble)
-{ //out << __func__ << endl;
+{
QString result;
for (unsigned int i= 0; i < vectorDouble.size(); i++) {
if (i != 0)
//------------------------------------------------------------------------------
QString vvMainWindow::GetVectorIntAsString(std::vector<int> vectorInt)
-{ //out << __func__ << endl;
+{
QString result;
for (unsigned int i= 0; i < vectorInt.size(); i++) {
if (i != 0)
//------------------------------------------------------------------------------
//this actually returns the SlicerManager index!
int vvMainWindow::GetSlicerIndexFromItem(QTreeWidgetItem* item)
-{ //out << __func__ << endl;
+{
QString id = item->data(COLUMN_IMAGE_NAME,Qt::UserRole).toString();
for (int i = 0; i < DataTree->topLevelItemCount(); i++) {
if (DataTree->topLevelItem(i)->data(COLUMN_IMAGE_NAME,Qt::UserRole).toString() == id)
//------------------------------------------------------------------------------
QTreeWidgetItem* vvMainWindow::GetItemFromSlicerManager(vvSlicerManager* sm)
-{ //out << __func__ << endl;
+{
QString id = sm->GetId().c_str();
for (int i = 0; i < DataTree->topLevelItemCount(); i++) {
if (DataTree->topLevelItem(i)->data(COLUMN_IMAGE_NAME,Qt::UserRole).toString() == id)
//------------------------------------------------------------------------------
void vvMainWindow::DisplayChanged(QTreeWidgetItem *clickedItem, int column)
-{ //out << __func__ << endl;
+{
if ( column >= COLUMN_CLOSE_IMAGE || column <= 0)
return;
//------------------------------------------------------------------------------
void vvMainWindow::InitSlicers()
-{ //out << __func__ << endl;
+{
if (mSlicerManagers.size()) {
mSlicerManagers.back()->GenerateDefaultLookupTable();
mSlicerManagers.back()->SetSlicerWindow(0,NOViewWidget->GetRenderWindow());
//------------------------------------------------------------------------------
void vvMainWindow::InitDisplay()
-{ //out << __func__ << endl;
+{
if (mSlicerManagers.size()) {
//BE CAREFUL : this is absolutely necessary to set the interactor style
//in order to have the same style instanciation for all SlicerManagers in
//------------------------------------------------------------------------------
void vvMainWindow::DisplaySliders(int slicer, int window)
-{ //out << __func__ << endl;
+{
if(!mSlicerManagers[slicer]->GetSlicer(window)->GetRenderer()->GetDraw())
return;
//------------------------------------------------------------------------------
void vvMainWindow::CloseImage(QTreeWidgetItem* item, int column)
-{ //out << __func__ << endl;
+{
int index = GetSlicerIndexFromItem(item);
if (DataTree->topLevelItem(index) != item) {
//------------------------------------------------------------------------------
void vvMainWindow::ReloadImage(QTreeWidgetItem* item, int column)
-{ //out << __func__ << endl;
+{
// int index = GetSlicerIndexFromItem(item);
// QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
// if (item->data(1,Qt::UserRole).toString() == "vector")
//------------------------------------------------------------------------------
void vvMainWindow::MousePositionChanged(int visibility,double x, double y, double z, double X, double Y, double Z , double value)
-{ //out << __func__ << endl;
+{
infoPanel->setCurrentInfo(visibility,x,y,z,X,Y,Z,value);
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
void vvMainWindow::VectorChanged(int visibility,double x, double y, double z, double value)
-{ //out << __func__ << endl;
+{
overlayPanel->getCurrentVectorInfo(visibility,x,y,z,value);
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
void vvMainWindow::OverlayChanged(int visibility, double valueOver, double valueRef)
-{ //out << __func__ << endl;
+{
overlayPanel->getCurrentOverlayInfo(visibility,valueOver, valueRef);
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
void vvMainWindow::FusionChanged(int visibility, double value)
-{ //out << __func__ << endl;
+{
overlayPanel->getCurrentFusionInfo(visibility,value);
}
//------------------------------------------------------------------------------
//or when UpdateWindowLevel() is called ; when slicerManager emits WindowLevelChanged
//when ImageInfoChanged() is called
void vvMainWindow::WindowLevelChanged()
-{ //out << __func__ << endl;
+{
// Base image
int index = GetSlicerIndexFromItem(DataTree->selectedItems()[0]);
if(index==-1) return;
//------------------------------------------------------------------------------
void vvMainWindow::WindowLevelEdited()
-{ //out << __func__ << endl;
+{
presetComboBox->setCurrentIndex(WL_USER);
UpdateWindowLevel();
}
//------------------------------------------------------------------------------
void vvMainWindow::SetWindowLevel(double w, double l)
-{ //out << __func__ << endl;
+{
windowSpinBox->setValue(w);
levelSpinBox->setValue(l);
presetComboBox->setCurrentIndex(WL_USER);
//------------------------------------------------------------------------------
void vvMainWindow::UpdateWindowLevel()
-{ //out << __func__ << endl;
+{
if (DataTree->selectedItems().size()) {
if (presetComboBox->currentIndex() == WL_VENTILATION) //For ventilation
colorMapComboBox->setCurrentIndex(5);
//------------------------------------------------------------------------------
void vvMainWindow::UpdateSlicingPreset()
-{ //out << __func__ << endl;
+{
if (DataTree->selectedItems().size()) {
int index = GetSlicerIndexFromItem(DataTree->selectedItems()[0]);
mSlicerManagers[index]->SetSlicingPreset(vvSlicerManager::SlicingPresetType(slicingPresetComboBox->currentIndex()));
//------------------------------------------------------------------------------
void vvMainWindow::UpdateColorMap()
-{ //out << __func__ << endl;
+{
if (DataTree->selectedItems().size()) {
int index = GetSlicerIndexFromItem(DataTree->selectedItems()[0]);
mSlicerManagers[index]->SetColorMap(colorMapComboBox->currentIndex());
}
//------------------------------------------------------------------------------
void vvMainWindow::SwitchWindowLevel()
-{ //out << __func__ << endl;
+{
int index = GetSlicerIndexFromItem(DataTree->selectedItems()[0]);
int window = mSlicerManagers[index]->GetColorWindow();
presetComboBox->setCurrentIndex(WL_USER);
//------------------------------------------------------------------------------
void vvMainWindow::ApplyWindowLevelToAllImages()
-{ //out << __func__ << endl;
+{
int index = GetSlicerIndexFromItem(DataTree->selectedItems()[0]);
if(index==-1) return;
double window = mSlicerManagers[index]->GetColorWindow();
//------------------------------------------------------------------------------
void vvMainWindow::ApplyWindowToSetOfImages(double window, unsigned int indexMin, unsigned int indexMax)
-{ //out << __func__ << endl;
+{
for (unsigned int i = indexMin; i <= indexMax && i < mSlicerManagers.size(); i++) {
if (mSlicerManagers[i] == NULL)
continue;
//------------------------------------------------------------------------------
void vvMainWindow::ApplyLevelToSetOfImages(double level, unsigned int indexMin, unsigned int indexMax)
-{ //out << __func__ << endl;
+{
for (unsigned int i = indexMin; i <= indexMax && i < mSlicerManagers.size(); i++) {
if (mSlicerManagers[i] == NULL)
continue;
//------------------------------------------------------------------------------
void vvMainWindow::UpdateLinkManager(std::string id, int slicer, double x, double y, double z, int temps)
-{ //out << __func__ << endl;
+{
for (unsigned int i = 0; i < mSlicerManagers.size(); i++) {
if (mSlicerManagers[i]->GetId() == id) {
mSlicerManagers[i]->GetSlicer(slicer)->SetCurrentPosition(x,y,z,temps);
//------------------------------------------------------------------------------
void vvMainWindow::UpdateLinkedNavigation(std::string id, vvSlicerManager * sm, vvSlicer* refSlicer)
-{ //out << __func__ << endl;
+{
for (unsigned int i = 0; i < mSlicerManagers.size(); i++) {
if (id == mSlicerManagers[i]->GetId()) {
mSlicerManagers[i]->UpdateLinkedNavigation(refSlicer);
//------------------------------------------------------------------------------
void vvMainWindow::ShowContextMenu(QPoint point)
-{ //out << __func__ << endl;
+{
if (!DataTree->selectedItems().size()) {
contextActions[1]->setEnabled(0);
contextActions[2]->setEnabled(0);
//------------------------------------------------------------------------------
void vvMainWindow::CloseImage()
-{ //out << __func__ << endl;
+{
CloseImage(DataTree->selectedItems()[0],0);
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
void vvMainWindow::ReloadImage()
-{ //out << __func__ << endl;
+{
ReloadImage(DataTree->selectedItems()[0],0);
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
void vvMainWindow::SelectOverlayImage()
-{ //out << __func__ << endl;
+{
int index = GetSlicerIndexFromItem(DataTree->selectedItems()[0]);
//check if one overlay image is added
//------------------------------------------------------------------------------
void vvMainWindow::AddOverlayImage(int index, std::vector<std::string> fileNames, vvImageReader::LoadedImageType type)
-{ //out << __func__ << endl;
+{
QString file(fileNames[0].c_str());
if (QFile::exists(file))
{
//------------------------------------------------------------------------------
void vvMainWindow::AddROI(int index, QString file)
-{ //out << __func__ << endl;
+{
/*
// Get slice manager
//------------------------------------------------------------------------------
void vvMainWindow::SelectFusionImage()
-{ //out << __func__ << endl;
+{
int index = GetSlicerIndexFromItem(DataTree->selectedItems()[0]);
//check if one fusion image is added
//------------------------------------------------------------------------------
void vvMainWindow::ResetTransformationToIdentity()
-{ //out << __func__ << endl;
+{
std::string actorType = DataTree->selectedItems()[0]->data(1,Qt::UserRole).toString().toStdString();
int index = GetSlicerIndexFromItem(DataTree->selectedItems()[0]);
mSlicerManagers[index]->ResetTransformationToIdentity(actorType);
//------------------------------------------------------------------------------
void vvMainWindow::AddFusionImage(int index, std::vector<std::string> fileNames, vvImageReader::LoadedImageType type)
-{ //out << __func__ << endl;
+{
QString file(fileNames[0].c_str());
if (QFile::exists(file))
{
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
void vvMainWindow::AddLandmarks(int index, std::vector<std::string> files)
-{ //out << __func__ << endl;
+{
if (!landmarksPanel->LoadFromFile(files))
QMessageBox::information(this,tr("Problem reading Landmarks !"),"File doesn't exist!");
//------------------------------------------------------------------------------
void vvMainWindow::OpenField()
-{ //out << __func__ << endl;
+{
int index = GetSlicerIndexFromItem(DataTree->selectedItems()[0]);
//check if a vector field has already been added
for (int child = 0; child < DataTree->topLevelItem(index)->childCount(); child++)
//------------------------------------------------------------------------------
void vvMainWindow::AddFieldEntry(QString filename,int index,bool from_disk)
-{ //out << __func__ << endl;
+{
//create an item in the tree with good settings
QTreeWidgetItem *item = new QTreeWidgetItem();
item->setData(0,Qt::UserRole,filename.toStdString().c_str());
//------------------------------------------------------------------------------
void vvMainWindow::AddField(vvImage::Pointer vf,QString file,int index)
-{ //out << __func__ << endl;
+{
QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
vvSlicerManager* imageManager = mSlicerManagers[index];
if (imageManager->SetVF(vf,file.toStdString())) {
//------------------------------------------------------------------------------
void vvMainWindow::AddField(QString file,int index)
-{ //out << __func__ << endl;
+{
if (QFile::exists(file)) {
mInputPathName = itksys::SystemTools::GetFilenamePath(file.toStdString()).c_str();
//------------------------------------------------------------------------------
void vvMainWindow::SetVFProperty(int subsampling, int scale, int log, int width, double r, double g, double b)
-{ //out << __func__ << endl;
+{
int index = GetSlicerIndexFromItem(DataTree->selectedItems()[0]);
if (mSlicerManagers[index]->GetSlicer(0)->GetVF()) {
for (int i = 0; i < 4; i++) {
//------------------------------------------------------------------------------
void vvMainWindow::SetOverlayProperty(int color, int linked, double window, double level)
-{ //out << __func__ << endl;
+{
int index = GetSlicerIndexFromItem(DataTree->selectedItems()[0]);
if (mSlicerManagers[index]->GetSlicer(0)->GetOverlay()) {
mSlicerManagers[index]->SetOverlayColor(color);
//------------------------------------------------------------------------------
void vvMainWindow::SetFusionProperty(int opacity, int thresOpacity, int colormap,double window, double level, bool showLegend)
-{ //out << __func__ << endl;
+{
int index = GetSlicerIndexFromItem(DataTree->selectedItems()[0]);
if (mSlicerManagers[index]->GetSlicer(0)->GetFusion()) {
mSlicerManagers[index]->SetFusionColorMap(colormap);
//------------------------------------------------------------------------------
void vvMainWindow::SelectFusionSequence()
-{ //out << __func__ << endl;
+{
//get the index of the slicer manager of the main sequence (CT)
int index = GetSlicerIndexFromItem(DataTree->selectedItems()[0]);
//check if one overlay image is already associated
//------------------------------------------------------------------------------
void vvMainWindow::SelectFusionSequenceCorrespondances()
-{ //out << __func__ << endl;
+{
//make sure the index is right?
//in the end, I should attach the temporal data to the right sequence!
int index = GetSlicerIndexFromItem(DataTree->selectedItems()[0]);
//when this function is called index is the slicer manager index corresponding to the main sequence (CT)
//the files behind fileNames points to the data for the secondary sequence
void vvMainWindow::AddFusionSequence(int index, std::vector<std::string> fileNames, vvImageReader::LoadedImageType type)
-{ //out << __func__ << endl;
+{
QString file(fileNames[0].c_str());
if (QFile::exists(file))
{
//------------------------------------------------------------------------------
//fusionSequenceFrameIndex and fusionSequenceNbFrames are relative to the secondary sequence (US)
void vvMainWindow::SetFusionSequenceProperty(int fusionSequenceFrameIndex, bool spatialSyncFlag, unsigned int fusionSequenceNbFrames, bool temporalSyncFlag)
-{ //out << __func__ << endl;
+{
int index = GetSlicerIndexFromItem(DataTree->selectedItems()[0]);
if (!mSlicerManagers[index]->IsInvolvedInFusionSequence()) return;
//------------------------------------------------------------------------------
void vvMainWindow::SaveAs()
-{ //out << __func__ << endl;
+{
if (DataTree->selectedItems()[0]->data(1,Qt::UserRole).toString() == "vector") {
QMessageBox::warning(this,tr("Unsupported type"),tr("Sorry, saving a vector field is unsupported for the moment"));
return;
//------------------------------------------------------------------------------
void vvMainWindow::SaveCurrentState()
-{ //out << __func__ << endl;
+{
QString Extensions = "XML Files(*.xml)";
QString fileName = QFileDialog::getSaveFileName(this,
tr("Save Current Window State"),
//------------------------------------------------------------------------------
void vvMainWindow::SaveCurrentStateAs(const std::string& stateFile)
-{ //out << __func__ << endl;
+{
vvSaveState save_state;
save_state.Run(this, stateFile);
}
//------------------------------------------------------------------------------
void vvMainWindow::ReadSavedState()
-{ //out << __func__ << endl;
+{
QString Extensions = "XML Files(*.xml)";
QString fileName = QFileDialog::getOpenFileName(this,
tr("Load Window State"),
//------------------------------------------------------------------------------
void vvMainWindow::ReadSavedStateFile(const std::string& stateFile)
-{ //out << __func__ << endl;
+{
vvReadState read_state;
read_state.Run(this, stateFile);
}
//------------------------------------------------------------------------------
void vvMainWindow::LinkAllImages()
-{ //out << __func__ << endl;
+{
linkPanel->linkAll();
}
//------------------------------------------------------------------------------
void vvMainWindow::AddLink(QString image1,QString image2,bool fromPanel)
-{ //out << __func__ << endl;
+{
if (!fromPanel) {
// delegate to linkPanel if call came from elsewhere...
linkPanel->addLinkFromIds(image1, image2);
//------------------------------------------------------------------------------
void vvMainWindow::RemoveLink(QString image1,QString image2)
-{ //out << __func__ << endl;
+{
for (unsigned int i = 0; i < mSlicerManagers.size(); i++) {
if (image1.toStdString() == mSlicerManagers[i]->GetId()) {
mSlicerManagers[i]->RemoveLink(image2.toStdString());
//------------------------------------------------------------------------------
void vvMainWindow::ChangeImageWithIndexOffset(vvSlicerManager *sm, int slicer, int offset)
-{ //out << __func__ << endl;
+{
if(mSlicerManagers.size()==1)
return;
}
//------------------------------------------------------------------------------
void vvMainWindow::HorizontalSliderMoved(int value,int column, int slicer_index)
-{ //out << __func__ << endl;
+{
for (unsigned int i = 0; i < mSlicerManagers.size(); i++) {
if (DataTree->topLevelItem(i)->data(column,Qt::CheckStateRole).toInt() > 1) {
//i is the SlicerManager that is in charge of this slicer.
//------------------------------------------------------------------------------
void vvMainWindow::NOHorizontalSliderMoved()
-{ //out << __func__ << endl;
+{
// if (mCurrentTime == NOHorizontalSlider->value()) return;
HorizontalSliderMoved(NOHorizontalSlider->value(),COLUMN_UL_VIEW,0);
// mCurrentTime = NOHorizontalSlider->value();
//------------------------------------------------------------------------------
void vvMainWindow::NEHorizontalSliderMoved()
-{ //out << __func__ << endl;
+{
// if (mCurrentTime == NEHorizontalSlider->value()) return;
HorizontalSliderMoved(NEHorizontalSlider->value(),COLUMN_UR_VIEW,1);
// mCurrentTime = NEHorizontalSlider->value();
//------------------------------------------------------------------------------
void vvMainWindow::SOHorizontalSliderMoved()
-{ //out << __func__ << endl;
+{
// if (mCurrentTime == SOHorizontalSlider->value()) return;
HorizontalSliderMoved(SOHorizontalSlider->value(),COLUMN_DL_VIEW,2);
// mCurrentTime = SOHorizontalSlider->value();
//------------------------------------------------------------------------------
void vvMainWindow::SEHorizontalSliderMoved()
-{ //out << __func__ << endl;
+{
// if (mCurrentTime == SEHorizontalSlider->value()) return;
HorizontalSliderMoved(SEHorizontalSlider->value(),COLUMN_DR_VIEW,3);
// mCurrentTime = SEHorizontalSlider->value();
//------------------------------------------------------------------------------
void vvMainWindow::NOVerticalSliderChanged()
-{ //out << __func__ << endl;
+{
static int value=-1;
if (value == NOVerticalSlider->value()) return;
else value = NOVerticalSlider->value();
//------------------------------------------------------------------------------
void vvMainWindow::NEVerticalSliderChanged()
-{ //out << __func__ << endl;
+{
static int value=-1;
if (value == NEVerticalSlider->value()) return;
else value = NEVerticalSlider->value();
//------------------------------------------------------------------------------
void vvMainWindow::SOVerticalSliderChanged()
-{ //out << __func__ << endl;
+{
static int value=-1;
if (value == SOVerticalSlider->value()) return;
else value = SOVerticalSlider->value();
//------------------------------------------------------------------------------
void vvMainWindow::SEVerticalSliderChanged()
-{ //out << __func__ << endl;
+{
static int value=-1;
if (value == SEVerticalSlider->value()) return;
else value = SEVerticalSlider->value();
//------------------------------------------------------------------------------
void vvMainWindow::UpdateSlice(int slicer, int slice)
-{ //out << __func__ << endl;
+{
// DD("vvMainWindow::UpdateSlice");
// DD(slicer);
// DD(slice);
//------------------------------------------------------------------------------
void vvMainWindow::UpdateTSlice(int slicer, int slice, int code)
-{ //out << __func__ << endl;
+{
//FusionSequence: the slider value should be updated for slicers which show the same sequence as requested
bool doUpdate=false;
if (code==-1) doUpdate=true;
//------------------------------------------------------------------------------
void vvMainWindow::UpdateSliceRange(int slicer, int min, int max, int tmin, int tmax)
-{ //out << __func__ << endl;
+{
//int position = int((min+max)/2);
int position = mSlicerManagers[mCurrentPickedImageIndex]->GetSlicer(slicer)->GetSlice();
if (slicer == 0) {
//------------------------------------------------------------------------------
void vvMainWindow::SaveNOScreenshot()
-{ //out << __func__ << endl;
+{
SaveScreenshot(NOViewWidget);
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
void vvMainWindow::SaveNEScreenshot()
-{ //out << __func__ << endl;
+{
SaveScreenshot(NEViewWidget);
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
void vvMainWindow::SaveSOScreenshot()
-{ //out << __func__ << endl;
+{
SaveScreenshot(SOViewWidget);
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
void vvMainWindow::SaveSEScreenshot()
-{ //out << __func__ << endl;
+{
SaveScreenshot(SEViewWidget);
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
void vvMainWindow::SaveScreenshotAllSlices()
-{ //out << __func__ << endl;
+{
QVTKWidget *widget = NOViewWidget;
int index = 0;// GetSlicerIndexFromItem(DataTree->selectedItems()[0]);
//------------------------------------------------------------------------------
void vvMainWindow::SaveScreenshot(QVTKWidget *widget)
-{ //out << __func__ << endl;
+{
QString Extensions = "Images( *.png);;";
Extensions += "Images( *.jpg);;";
Extensions += "Images( *.bmp);;";
//------------------------------------------------------------------------------
void vvMainWindow::GoToCursor()
-{ //out << __func__ << endl;
+{
int index = GetSlicerIndexFromItem(DataTree->selectedItems()[0]);
for (int column = 1; column < 5; column++) {
if (DataTree->selectedItems()[0]->data(column,Qt::CheckStateRole).toInt() > 1) {
//------------------------------------------------------------------------------
void vvMainWindow::GoToLandmark()
-{ //out << __func__ << endl;
+{
int index = GetSlicerIndexFromItem(DataTree->selectedItems()[0]);
for (int column = 1; column < 5; column++) {
if (DataTree->selectedItems()[0]->data(column,Qt::CheckStateRole).toInt() > 1) {
//------------------------------------------------------------------------------
void vvMainWindow::PlayPause()
-{ //out << __func__ << endl;
+{
if (playMode) {
playMode = 0;
playButton->setIcon(QIcon(QString::fromUtf8(":/common/icons/player_play.png")));
//------------------------------------------------------------------------------
void vvMainWindow::PlayNext()
-{ //out << __func__ << endl;
+{
if (playMode && !this->isHidden()) {
int image_number=DataTree->topLevelItemCount();
///Only play one slicer per SM, and only if the SM is being displayed
//------------------------------------------------------------------------------
void vvMainWindow::ShowLastImage()
-{ //out << __func__ << endl;
+{
if (mSlicerManagers.size() > 1) {
QTreeWidgetItem * item=DataTree->topLevelItem(DataTree->topLevelItemCount()-1);
CurrentImageChanged(mSlicerManagers.back()->GetId()); //select new image
//------------------------------------------------------------------------------
void vvMainWindow::UpdateRenderWindows()
-{ //out << __func__ << endl;
+{
for (unsigned int i = 0; i < mSlicerManagers.size(); i++) {
mSlicerManagers[i]->GetSlicer(0)->UpdateLandmarks();
mSlicerManagers[i]->GetSlicer(1)->UpdateLandmarks();
//------------------------------------------------------------------------------
void vvMainWindow::SegmentationOnCurrentImage()
-{ //out << __func__ << endl;
+{
int index = GetSlicerIndexFromItem(DataTree->selectedItems()[0]);
vvSegmentationDialog segmentation;
//------------------------------------------------------------------------------
void vvMainWindow::SurfaceViewerLaunch()
-{ //out << __func__ << endl;
+{
vvSurfaceViewerDialog surfaceViewer;
surfaceViewer.exec();
}
//------------------------------------------------------------------------------
int vvMainWindow::GetImageDuplicateFilenameNumber(std::string filename)
-{ //out << __func__ << endl;
+{
int number=0;
for(unsigned int l=0; l<mSlicerManagers.size(); l++) {
vvSlicerManager * v = mSlicerManagers[l];
//------------------------------------------------------------------------------
vvSlicerManager* vvMainWindow::AddImage(vvImage::Pointer image,std::string filename)
-{ //out << __func__ << endl;
+{
// Change filename if another image exist with the same name
int number = GetImageDuplicateFilenameNumber(filename);
//------------------------------------------------------------------------------
void vvMainWindow::UpdateCurrentSlicer()
-{ //out << __func__ << endl;
+{
int index = -1;
if (DataTree->selectedItems().size() > 0) {
index = GetSlicerIndexFromItem(DataTree->selectedItems()[0]);
//------------------------------------------------------------------------------
vvROIActor::vvROIActor()
-{ //out << __func__ << endl;
+{
mIsVisible = true;
mIsContourVisible = false;
mOpacity = 0.5;
//------------------------------------------------------------------------------
vvROIActor::~vvROIActor()
-{ //out << __func__ << endl;
+{
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
void vvROIActor::RemoveActors()
-{ //out << __func__ << endl;
+{
for(unsigned int i= 0; i<mOverlayActors.size(); i++) {
mOverlayActors[i]->RemoveActors();
}
//------------------------------------------------------------------------------
void vvROIActor::SetROI(clitk::DicomRT_ROI * s)
-{ //out << __func__ << endl;
+{
mROI = s;
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
void vvROIActor::SetContourWidth(int n)
-{ //out << __func__ << endl;
+{
mContourWidth = n;
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
void vvROIActor::SetSlicerManager(vvSlicerManager * s)
-{ //out << __func__ << endl;
+{
mSlicerManager = s;
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
void vvROIActor::UpdateImage()
-{ //out << __func__ << endl;
+{
mOverlayActors.clear();
mImageContour.clear();
Initialize(mDepth, mIsVisible);
//------------------------------------------------------------------------------
void vvROIActor::SetVisible(bool b)
-{ //out << __func__ << endl;
+{
mIsVisible = b;
if (!b) { // remove actor
for(unsigned int i= 0; i<mOverlayActors.size(); i++)
//------------------------------------------------------------------------------
void vvROIActor::SetContourVisible(bool b)
-{ //out << __func__ << endl;
+{
mIsContourVisible = b;
if (!b) { // remove actor
for(unsigned int i= 0; i<mImageContour.size(); i++) {
//------------------------------------------------------------------------------
bool vvROIActor::IsVisible()
-{ //out << __func__ << endl;
+{
return mIsVisible;
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
bool vvROIActor::IsContourVisible()
-{ //out << __func__ << endl;
+{
return mIsContourVisible;
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
void vvROIActor::Initialize(double depth, bool IsVisible)
-{ //out << __func__ << endl;
+{
if (mROI->GetImage()) {
mImageContour.clear();
mOverlayActors.clear();
//------------------------------------------------------------------------------
void vvROIActor::SetDepth(double d)
-{ //out << __func__ << endl;
+{
mDepth = d;
if (!mSlicerManager) return;
for(int i=0; i<mSlicerManager->GetNumberOfSlicers(); i++) {
//------------------------------------------------------------------------------
void vvROIActor::Update(bool force)
-{ //out << __func__ << endl;
+{
if (!mSlicerManager) return;
for(int i=0; i<mSlicerManager->GetNumberOfSlicers(); i++) {
UpdateSlice(i, mSlicerManager->GetSlicer(i)->GetSlice(), force);
//------------------------------------------------------------------------------
void vvROIActor::UpdateSlice(int slicer, int slices, bool force)
-{ //out << __func__ << endl;
+{
if (!mROI->GetImage()) return;
if ((!mIsVisible) && (!mIsContourVisible)) return;
if (!mSlicerManager) {
//------------------------------------------------------------------------------
void vvROIActor::SetOpacity(double d)
-{ //out << __func__ << endl;
+{
mOpacity = d;
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
void vvROIActor::SetContourColor(double r, double v, double b)
-{ //out << __func__ << endl;
+{
mContourColor[0] = r;
mContourColor[1] = v;
mContourColor[2] = b;
//------------------------------------------------------------------------------
void vvROIActor::SetOverlayColor(double r, double v, double b)
-{ //out << __func__ << endl;
+{
if (mROI)
mROI->SetDisplayColor(r,v,b);
}
//------------------------------------------------------------------------------
std::vector<double> & vvROIActor::GetContourColor()
-{ //out << __func__ << endl;
+{
return mContourColor;
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
std::vector<double> & vvROIActor::GetOverlayColor()
-{ //out << __func__ << endl;
+{
return mROI->GetDisplayColor();
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
void vvROIActor::UpdateColor()
-{ //out << __func__ << endl;
+{
for(unsigned int i=0; i<mOverlayActors.size(); i++) {
mOverlayActors[i]->SetOpacity(mOpacity);
mOverlayActors[i]->SetColor(mROI->GetDisplayColor()[0],
//------------------------------------------------------------------------------
double vvROIActor::GetOpacity()
-{ //out << __func__ << endl;
+{
return mOpacity;
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
void vvROIActor::SetSelected(bool b)
-{ //out << __func__ << endl;
+{
mIsSelected = b;
if (b) {
for(int i=0; i<mSlicerManager->GetNumberOfSlicers(); i++) {
//------------------------------------------------------------------------------
void vvROIActor::CopyParameters(QSharedPointer<vvROIActor> roi)
-{ //out << __func__ << endl;
+{
// Overlay
SetVisible(roi->IsVisible());
SetOpacity(roi->GetOpacity());
}
//------------------------------------------------------------------------------
vvSlicer::vvSlicer()
-{ //out << __func__ << endl;
+{
mFusionSequenceCode = -1;
this->UnInstallPipeline();
mImage = NULL;
//------------------------------------------------------------------------------
vtkImageMapToWindowLevelColors* vvSlicer::GetOverlayMapper()
-{ //out << __func__ << endl;
+{
return mOverlayMapper.GetPointer();
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
vvBlendImageActor* vvSlicer::GetOverlayActor()
-{ //out << __func__ << endl;
+{
return mOverlayActor.GetPointer();
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
vtkImageMapToColors* vvSlicer::GetFusionMapper()
-{ //out << __func__ << endl;
+{
return mFusionMapper.GetPointer();
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
vtkImageActor* vvSlicer::GetFusionActor()
-{ //out << __func__ << endl;
+{
return mFusionActor.GetPointer();
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
vtkActor* vvSlicer::GetVFActor()
-{ //out << __func__ << endl;
+{
return mVFActor.GetPointer();
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
vtkCornerAnnotation* vvSlicer::GetAnnotation()
-{ //out << __func__ << endl;
+{
return ca.GetPointer();
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
void vvSlicer::EnableReducedExtent(bool b)
-{ //out << __func__ << endl;
+{
mUseReducedExtent = b;
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
void vvSlicer::SetReducedExtent(int * ext)
-{ //out << __func__ << endl;
+{
copyExtent(ext, mReducedExtent);
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
void vvSlicer::AddContour(vvMesh::Pointer contour,bool propagate)
-{ //out << __func__ << endl;
+{
mSurfaceCutActors.push_back(new vvMeshActor());
if (propagate)
//------------------------------------------------------------------------------
void vvSlicer::ToggleContourSuperposition()
-{ //out << __func__ << endl;
+{
for (std::vector<vvMeshActor*>::iterator i=mSurfaceCutActors.begin();
i!=mSurfaceCutActors.end(); i++)
(*i)->ToggleSuperposition();
//------------------------------------------------------------------------------
void vvSlicer::SetCursorColor(int r,int g, int b)
-{ //out << __func__ << endl;
+{
pdmA->GetProperty()->SetColor(r,g,b);
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
void vvSlicer::SetCursorVisibility(bool s)
-{ //out << __func__ << endl;
+{
pdmA->SetVisibility(s);
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
bool vvSlicer::GetCursorVisibility()
-{ //out << __func__ << endl;
+{
return pdmA->GetVisibility();
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
void vvSlicer::SetCornerAnnotationVisibility(bool s)
-{ //out << __func__ << endl;
+{
ca->SetVisibility(s);
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
bool vvSlicer::GetCornerAnnotationVisibility()
-{ //out << __func__ << endl;
+{
return ca->GetVisibility();
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
vvSlicer::~vvSlicer()
-{ //out << __func__ << endl;
+{
for (std::vector<vvMeshActor*>::iterator i=mSurfaceCutActors.begin();
i!=mSurfaceCutActors.end(); i++)
delete (*i);
//------------------------------------------------------------------------------
double* vvSlicer::GetCurrentPosition()
-{ //out << __func__ << endl;
+{
return mCurrentBeforeSlicingTransform;
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
void vvSlicer::SetCurrentPosition(double x, double y, double z, int t)
-{ //out << __func__ << endl;
+{
mCurrentBeforeSlicingTransform[0]=x;
mCurrentBeforeSlicingTransform[1]=y;
mCurrentBeforeSlicingTransform[2]=z;
//------------------------------------------------------------------------------
void vvSlicer::SetImage(vvImage::Pointer image)
-{ //out << __func__ << endl;
+{
if (image->GetVTKImages().size()) {
mImage = image;
//------------------------------------------------------------------------------
void vvSlicer::SetOverlay(vvImage::Pointer overlay)
-{ //out << __func__ << endl;
+{
if (overlay->GetVTKImages().size()) {
mOverlay = overlay;
mOverlayVisibility = true;
//------------------------------------------------------------------------------
void vvSlicer::SetFusion(vvImage::Pointer fusion, int fusionSequenceCode)
-{ //out << __func__ << endl;
+{
mFusionSequenceCode = fusionSequenceCode;
if (fusion->GetVTKImages().size()) {
mFusion = fusion;
//------------------------------------------------------------------------------
bool vvSlicer::GetActorVisibility(const std::string& actor_type, int overlay_index)
-{ //out << __func__ << endl;
+{
bool vis = false;
if (actor_type == "image")
vis = mImageVisibility;
//------------------------------------------------------------------------------
void vvSlicer::SetActorVisibility(const std::string& actor_type, int overlay_index ,bool vis)
-{ //out << __func__ << endl;
+{
if (actor_type == "image")
mImageVisibility = vis;
else if (actor_type == "vector")
//------------------------------------------------------------------------------
void vvSlicer::SetVF(vvImage::Pointer vf)
-{ //out << __func__ << endl;
+{
if (vf->GetVTKImages().size()) {
mVF = vf;
mVFVisibility = true;
//------------------------------------------------------------------------------
void vvSlicer::SetLandmarks(vvLandmarks* landmarks)
-{ //out << __func__ << endl;
+{
mLandmarks = landmarks;
if (landmarks) {
//------------------------------------------------------------------------------
//FIXME: this function leaks memory, we should fix it someday :)
void vvSlicer::RemoveActor(const std::string& actor_type, int overlay_index)
-{ //out << __func__ << endl;
+{
if (actor_type == "vector") {
Renderer->RemoveActor(mVFActor);
mGlyphFilter=NULL;
//------------------------------------------------------------------------------
void vvSlicer::SetVFSubSampling(int sub)
-{ //out << __func__ << endl;
+{
if (mVOIFilter) {
mVOIFilter->SetSampleRate(mSubSampling,mSubSampling,mSubSampling);
mSubSampling = sub;
//------------------------------------------------------------------------------
void vvSlicer::SetVFScale(int scale)
-{ //out << __func__ << endl;
+{
mScale = scale;
if (mArrow)
mArrow->SetScale(mScale);
//------------------------------------------------------------------------------
void vvSlicer::SetVFWidth(int width)
-{ //out << __func__ << endl;
+{
mVFWidth = width;
if (mVFActor)
mVFActor->GetProperty()->SetLineWidth(mVFWidth);
//------------------------------------------------------------------------------
void vvSlicer::SetVFLog(int log)
-{ //out << __func__ << endl;
+{
mVFLog = log;
if (mGlyphFilter) {
mGlyphFilter->SetUseLog(mVFLog);
//------------------------------------------------------------------------------
void vvSlicer::SetTSlice(int t, bool updateLinkedImages)
-{ //out << __func__ << endl;
+{
if (!updateLinkedImages) {
mCurrentTSlice = t;
#if VTK_MAJOR_VERSION <= 5
//------------------------------------------------------------------------------
void vvSlicer::SetFusionSequenceTSlice(int t)
-{ //out << __func__ << endl;
+{
if (mFusion && mFusionActor->GetVisibility() && (mFusionSequenceCode>=0)) {
if (mFusion->GetVTKImages().size() > (unsigned int)t) {
mCurrentFusionTSlice = t;
//------------------------------------------------------------------------------
int vvSlicer::GetTSlice()
-{ //out << __func__ << endl;
+{
return mCurrentTSlice;
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
int vvSlicer::GetMaxCurrentTSlice()
-{ //out << __func__ << endl;
+{
int t = mCurrentTSlice;
if(mOverlay)
t = std::max(t, mCurrentOverlayTSlice);
//------------------------------------------------------------------------------
int vvSlicer::GetFusionTSlice()
-{ //out << __func__ << endl;
+{
return mCurrentFusionTSlice;
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
int vvSlicer::GetOverlayTSlice()
-{ //out << __func__ << endl;
+{
return mCurrentOverlayTSlice;
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
void vvSlicer::SetSliceOrientation(int orientation)
-{ //out << __func__ << endl;
+{
//if 2D image, force to watch in Axial View
int extent[6];
#if VTK_MAJOR_VERSION <= 5
// In other words, we change the grid of the reslice in the same way as the grid
// of the displayed image in the slicing direction.
void vvSlicer::AdjustResliceToSliceOrientation(vtkImageReslice *reslice)
-{ //out << __func__ << endl;
+{
// Reset autocrop and update output information
reslice->SetOutputOriginToDefault();
reslice->SetOutputSpacingToDefault();
//----------------------------------------------------------------------------
int * vvSlicer::GetExtent()
-{ //out << __func__ << endl;
+{
int *w_ext;
if (mUseReducedExtent) {
w_ext = mReducedExtent;
//----------------------------------------------------------------------------
int vvSlicer::GetOrientation()
-{ //out << __func__ << endl;
+{
return this->SliceOrientation;
}
//----------------------------------------------------------------------------
//----------------------------------------------------------------------------
void vvSlicer::UpdateDisplayExtent()
-{ //out << __func__ << endl;
+{
vtkImageData *input = this->GetInput();
if (!input || !this->ImageActor) {
//----------------------------------------------------------------------------
void vvSlicer::ConvertImageToImageDisplayExtent(vtkImageData *sourceImage, const int sourceExtent[6],
vtkImageData *targetImage, int targetExtent[6])
-{ //out << __func__ << endl;
+{
double dExtents[6];
for(unsigned int i=0; i<6; i++) {
// From source voxel coordinates to world coordinates
//----------------------------------------------------------------------------
bool vvSlicer::ClipDisplayedExtent(int extent[6], int refExtent[6])
-{ //out << __func__ << endl;
+{
bool out = false;
int maxBound = 6;
//----------------------------------------------------------------------------
void vvSlicer::UpdateOrientation()
-{ //out << __func__ << endl;
+{
// Set the camera position
vtkCamera *cam = this->Renderer ? this->Renderer->GetActiveCamera() : NULL;
if (cam) {
//----------------------------------------------------------------------------
void vvSlicer::SetOpacity(double s)
-{ //out << __func__ << endl;
+{
this->GetImageActor()->SetOpacity(s);
}
//----------------------------------------------------------------------------
//----------------------------------------------------------------------------
void vvSlicer::SetRenderWindow(int orientation, vtkRenderWindow * rw)
-{ //out << __func__ << endl;
+{
this->Superclass::SetRenderWindow(rw);
this->SetupInteractor(rw->GetInteractor());
ca->SetImageActor(this->GetImageActor());
//----------------------------------------------------------------------------
void vvSlicer::ResetCamera()
-{ //out << __func__ << endl;
+{
this->GetRenderer()->ResetCamera();
}
//----------------------------------------------------------------------------
//----------------------------------------------------------------------------
void vvSlicer::SetDisplayMode(bool i)
-{ //out << __func__ << endl;
+{
this->GetRenderer()->SetDraw(i);
if (i) UpdateDisplayExtent();
}
//----------------------------------------------------------------------------
void vvSlicer::FlipHorizontalView()
-{ //out << __func__ << endl;
+{
vtkCamera *cam = this->Renderer ? this->Renderer->GetActiveCamera() : NULL;
if (cam) {
double *position = cam->GetPosition();
//----------------------------------------------------------------------------
void vvSlicer::FlipVerticalView()
-{ //out << __func__ << endl;
+{
vtkCamera *cam = this->Renderer ? this->Renderer->GetActiveCamera() : NULL;
if (cam) {
FlipHorizontalView();
//----------------------------------------------------------------------------
void vvSlicer::SetColorWindow(double window)
-{ //out << __func__ << endl;
+{
vtkLookupTable* LUT = static_cast<vtkLookupTable*>(this->GetWindowLevel()->GetLookupTable());
if ( LUT ) {
double level = this->GetWindowLevel()->GetLevel();
//----------------------------------------------------------------------------
void vvSlicer::SetColorLevel(double level)
-{ //out << __func__ << endl;
+{
vtkLookupTable* LUT = static_cast<vtkLookupTable*>(this->GetWindowLevel()->GetLookupTable());
if ( LUT ) {
double window = this->GetWindowLevel()->GetWindow();
//----------------------------------------------------------------------------
double vvSlicer::GetOverlayColorWindow()
-{ //out << __func__ << endl;
+{
if(mOverlayMapper)
return mOverlayMapper->GetWindow();
else
//----------------------------------------------------------------------------
double vvSlicer::GetOverlayColorLevel()
-{ //out << __func__ << endl;
+{
if(mOverlayMapper)
return mOverlayMapper->GetLevel();
else
//----------------------------------------------------------------------------
void vvSlicer::SetOverlayColorWindow(double window)
-{ //out << __func__ << endl;
+{
if(mOverlayMapper)
mOverlayMapper->SetWindow(window);
}
//----------------------------------------------------------------------------
void vvSlicer::SetOverlayColorLevel(double level)
-{ //out << __func__ << endl;
+{
if(mOverlayMapper)
mOverlayMapper->SetLevel(level);
}
//----------------------------------------------------------------------------
// Returns the min an the max value in a 20%x20% region around the mouse pointer
void vvSlicer::GetExtremasAroundMousePointer(double & min, double & max, vtkImageData *image, vtkTransform *transform)
-{ //out << __func__ << endl;
+{
//Get mouse pointer position in view coordinates
double corner1[3];
double corner2[3];
//----------------------------------------------------------------------------
double vvSlicer::GetScalarComponentAsDouble(vtkImageData *image, double X, double Y, double Z, int &ix, int &iy, int &iz, int component)
-{ //out << __func__ << endl;
+{
ix = lrint(X);
iy = lrint(Y);
iz = lrint(Z);
//----------------------------------------------------------------------------
void vvSlicer::Render()
-{ //out << __func__ << endl;
+{
if (this->mFusion && mFusionActor->GetVisibility() && showFusionLegend) {
legend->SetLookupTable(this->GetFusionMapper()->GetLookupTable());
//----------------------------------------------------------------------------
void vvSlicer::UpdateCursorPosition()
-{ //out << __func__ << endl;
+{
pdmA->SetVisibility(true);
mCursor[0] = mCurrent[0];
mCursor[1] = mCurrent[1];
//----------------------------------------------------------------------------
void vvSlicer::UpdateLandmarks()
-{ //out << __func__ << endl;
+{
vtkPolyData *pd = static_cast<vtkPolyData*>(mLandClipper->GetInput());
if (pd->GetPoints()) {
//mLandGlyph->SetRange(0,1);
//----------------------------------------------------------------------------
void vvSlicer::SetSlice(int slice)
-{ //out << __func__ << endl;
+{
int *range = this->GetSliceRange();
if (range) {
if (slice < range[0]) {
//----------------------------------------------------------------------------
int vvSlicer::GetTMax()
-{ //out << __func__ << endl;
+{
int tmax = (int)mImage->GetVTKImages().size() - 1;
if(mOverlay)
tmax = std::max(tmax, (int)mOverlay->GetVTKImages().size()-1);
//----------------------------------------------------------------------------
void vvSlicer::SetContourSlice()
-{ //out << __func__ << endl;
+{
if (mSurfaceCutActors.size() > 0)
for (std::vector<vvMeshActor*>::iterator i=mSurfaceCutActors.begin();
i!=mSurfaceCutActors.end(); i++) {
//----------------------------------------------------------------------------
void vvSlicer::ForceUpdateDisplayExtent()
-{ //out << __func__ << endl;
+{
this->UpdateDisplayExtent();
}
//----------------------------------------------------------------------------
//----------------------------------------------------------------------------
int* vvSlicer::GetDisplayExtent()
-{ //out << __func__ << endl;
+{
return this->GetImageActor()->GetDisplayExtent();
}
//----------------------------------------------------------------------------
//----------------------------------------------------------------------------
void vvSlicer::PrintSelf(ostream& os, vtkIndent indent)
-{ //out << __func__ << endl;
+{
this->Superclass::PrintSelf(os, indent);
}
//----------------------------------------------------------------------------
//----------------------------------------------------------------------------
void vvSlicer::SetVFColor(double r, double g, double b)
-{ //out << __func__ << endl;
+{
double mVFColorHSV[3];
mVFColor[0] = r;
mVFColor[1] = g;
//----------------------------------------------------------------------------
void vvSlicer::SetRegisterExtent(int ext[6])
-{ //out << __func__ << endl;
+{
copyExtent(ext, mRegisterExtent);
}
//----------------------------------------------------------------------------
//----------------------------------------------------------------------------
void vvSlicer::GetRegisterExtent(int ext[6])
-{ //out << __func__ << endl;
+{
copyExtent(mRegisterExtent, ext);
}
//----------------------------------------------------------------------------
#include <QMessageBox>\r
//----------------------------------------------------------------------------\r
vvSlicerManager::vvSlicerManager(int numberOfSlicers)\r
-{ //out << __func__ << endl;\r
+{ \r
mFileName = "";\r
mId = "";\r
mVFName = "";\r
\r
//----------------------------------------------------------------------------\r
vvSlicerManager::~vvSlicerManager()\r
-{ //out << __func__ << endl;\r
+{ \r
if (mLandmarks)\r
delete mLandmarks;\r
}\r
\r
//------------------------------------------------------------------------------\r
void vvSlicerManager::SetFilename(std::string filename, int number)\r
-{ //out << __func__ << endl;\r
+{ \r
mFileName = filename;\r
mFileName = vtksys::SystemTools::GetFilenameName(mFileName);\r
mBaseFileName = vtksys::SystemTools::GetFilenameName(vtksys::SystemTools::GetFilenameWithoutLastExtension(mFileName));\r
\r
//----------------------------------------------------------------------------\r
void vvSlicerManager::AddContour(vvMesh::Pointer contour,bool propagate)\r
-{ //out << __func__ << endl;\r
+{ \r
for ( unsigned int i = 0; i < mSlicers.size(); i++) {\r
mSlicers[i]->AddContour(contour,propagate);\r
}\r
\r
//----------------------------------------------------------------------------\r
void vvSlicerManager::ToggleContourSuperposition()\r
-{ //out << __func__ << endl;\r
+{ \r
for ( unsigned int i = 0; i < mSlicers.size(); i++)\r
mSlicers[i]->ToggleContourSuperposition();\r
}\r
\r
//----------------------------------------------------------------------------\r
std::string vvSlicerManager::GetListOfAbsoluteFilePathInOneString(const std::string &actorType)\r
-{ //out << __func__ << endl;\r
+{ \r
vvImageReader *reader = NULL;\r
\r
if(actorType=="image")\r
\r
//----------------------------------------------------------------------------\r
bool vvSlicerManager::SetImage(std::string filename, vvImageReader::LoadedImageType type, int n, unsigned int slice)\r
-{ //out << __func__ << endl;\r
+{ \r
mType = type;\r
if (mReader.IsNull())\r
mReader = vvImageReader::New();\r
\r
//----------------------------------------------------------------------------\r
void vvSlicerManager::SetImage(vvImage::Pointer image)\r
-{ //out << __func__ << endl;\r
+{ \r
mImage=image;\r
for (unsigned int i = 0; i < mSlicers.size(); i++) {\r
mSlicers[i]->SetImage(image);\r
\r
//----------------------------------------------------------------------------\r
bool vvSlicerManager::SetImages(std::vector<std::string> filenames, vvImageReader::LoadedImageType type, int n)\r
-{ //out << __func__ << endl;\r
+{ \r
mType = type;\r
std::string fileWithoutExtension = vtksys::SystemTools::GetFilenameWithoutExtension(filenames[0]);\r
if (type == vvImageReader::DICOM)\r
\r
//----------------------------------------------------------------------------\r
bool vvSlicerManager::SetOverlay(std::vector<std::string> filenames,int dim, std::string component, vvImageReader::LoadedImageType type)\r
-{ //out << __func__ << endl;\r
+{ \r
mOverlayName = filenames[0];\r
mOverlayComponent = component;\r
if (dim > mImage->GetNumberOfDimensions()) {\r
\r
//----------------------------------------------------------------------------\r
bool vvSlicerManager::SetFusion(std::vector<std::string> filenames,int dim, std::string component, vvImageReader::LoadedImageType type)\r
-{ //out << __func__ << endl;\r
+{ \r
mFusionName = filenames[0];\r
mFusionComponent = component;\r
if (dim > mImage->GetNumberOfDimensions()) {\r
//----------------------------------------------------------------------------\r
//this function is called by vvMainWindow::AddFusionSequence for the primary sequence (CT), while the given files constitute the secondary sequence.\r
bool vvSlicerManager::SetFusionSequence(std::vector<std::string> filenames, int dim, std::string component, vvImageReader::LoadedImageType type)\r
-{ //out << __func__ << endl;\r
+{ \r
mFusionSequenceInvolvementCode = 0;\r
\r
mFusionName = filenames[0];\r
\r
//----------------------------------------------------------------------------\r
bool vvSlicerManager::SetVF(std::string filename)\r
-{ //out << __func__ << endl;\r
+{ \r
if (mVectorReader.IsNull())\r
mVectorReader = vvImageReader::New();\r
mVectorReader->SetInputFilename(filename);\r
\r
//----------------------------------------------------------------------------\r
bool vvSlicerManager::SetVF(vvImage::Pointer vf,std::string filename)\r
-{ //out << __func__ << endl;\r
+{ \r
if (vf->GetNumberOfDimensions() > mImage->GetNumberOfDimensions()) {\r
mLastError = "Sorry, vector field dimension cannot be greater then reference image.";\r
return false;\r
\r
//----------------------------------------------------------------------------\r
vvSlicer* vvSlicerManager::GetSlicer(int i)\r
-{ //out << __func__ << endl;\r
+{ \r
return mSlicers[i];\r
}\r
//----------------------------------------------------------------------------\r
\r
//----------------------------------------------------------------------------\r
void vvSlicerManager::UpdateSlicer(int num, bool state)\r
-{ //out << __func__ << endl;\r
+{ \r
if (mSlicers[num]->GetImage()) {\r
mSlicers[num]->SetDisplayMode(state);\r
}\r
\r
//----------------------------------------------------------------------------\r
void vvSlicerManager::SetSlicerWindow(int i, vtkRenderWindow* RW)\r
-{ //out << __func__ << endl;\r
+{ \r
mSlicers[i]->SetRenderWindow(i,RW);\r
}\r
//----------------------------------------------------------------------------\r
\r
//----------------------------------------------------------------------------\r
void vvSlicerManager::SetInteractorStyleNavigator(int i, vtkInteractorStyle* style)\r
-{ //out << __func__ << endl;\r
+{ \r
vvSlicerManagerCommand *smc = vvSlicerManagerCommand::New();\r
smc->SM = this;\r
smc->SetSlicerNumber(i);\r
\r
//----------------------------------------------------------------------------\r
void vvSlicerManager::LeftButtonReleaseEvent(int slicer)\r
-{ //out << __func__ << endl;\r
+{ \r
emit LeftButtonReleaseSignal(slicer);\r
}\r
//----------------------------------------------------------------------------\r
\r
//----------------------------------------------------------------------------\r
void vvSlicerManager::EmitMousePositionUpdated(int slicer)\r
-{ //out << __func__ << endl;\r
+{ \r
emit MousePositionUpdatedSignal(slicer);\r
}\r
//----------------------------------------------------------------------------\r
\r
//----------------------------------------------------------------------------\r
void vvSlicerManager::EmitKeyPressed(std::string KeyPress)\r
-{ //out << __func__ << endl;\r
+{ \r
emit KeyPressedSignal(KeyPress);\r
}\r
//----------------------------------------------------------------------------\r
\r
//----------------------------------------------------------------------------\r
void vvSlicerManager::SetSliceOrientation(int slicer, int orientation)\r
-{ //out << __func__ << endl;\r
+{ \r
mSlicers[slicer]->SetSliceOrientation(orientation);\r
emit UpdateOrientation(slicer, orientation);\r
}\r
\r
//----------------------------------------------------------------------------\r
int vvSlicerManager::GetTSlice()\r
-{ //out << __func__ << endl;\r
+{ \r
return mSlicers[0]->GetTSlice();\r
}\r
//----------------------------------------------------------------------------\r
\r
//----------------------------------------------------------------------------\r
void vvSlicerManager::SetTSlice(int slice, bool updateLinkedImages)\r
-{ //out << __func__ << endl;\r
+{ \r
if (!updateLinkedImages) { //for fusionSequence, TMax / MaxCurrentTSlice are irrelevant.\r
for ( unsigned int i = 0; i < mSlicers.size(); i++) {\r
mSlicers[i]->SetTSlice(slice, updateLinkedImages);\r
\r
//----------------------------------------------------------------------------\r
void vvSlicerManager::SetFusionSequenceTSlice(int slice)\r
-{ //out << __func__ << endl;\r
+{ \r
for ( unsigned int i = 0; i < mSlicers.size(); i++) {\r
mSlicers[i]->SetFusionSequenceTSlice(slice);\r
UpdateTSlice(i);\r
\r
//----------------------------------------------------------------------------\r
void vvSlicerManager::SetNextTSlice(int originating_slicer)\r
-{ //out << __func__ << endl;\r
+{ \r
int t = mSlicers[0]->GetMaxCurrentTSlice();\r
t++;\r
if (t > mSlicers[0]->GetTMax())\r
\r
//----------------------------------------------------------------------------\r
void vvSlicerManager::SetPreviousTSlice(int originating_slicer)\r
-{ //out << __func__ << endl;\r
+{ \r
int t = mSlicers[0]->GetMaxCurrentTSlice();\r
t--;\r
if (t < 0)\r
\r
//----------------------------------------------------------------------------\r
void vvSlicerManager::ToggleInterpolation()\r
-{ //out << __func__ << endl;\r
+{ \r
bool interpolate=!(mSlicers[0]->GetImageActor()->GetInterpolate());\r
for ( unsigned int i = 0; i < mSlicers.size(); i++) {\r
mSlicers[i]->GetImageActor()->SetInterpolate(interpolate);\r
\r
//----------------------------------------------------------------------------\r
void vvSlicerManager::SetTSliceInSlicer(int tslice, int slicer)\r
-{ //out << __func__ << endl;\r
+{ \r
if (tslice < 0)\r
tslice = 0;\r
else if (tslice > mSlicers[slicer]->GetTMax())\r
\r
//----------------------------------------------------------------------------\r
void vvSlicerManager::SetColorWindow(double s)\r
-{ //out << __func__ << endl;\r
+{ \r
for ( unsigned int i = 0; i < mSlicers.size(); i++) {\r
mSlicers[i]->SetColorWindow(s);\r
}\r
\r
//----------------------------------------------------------------------------\r
void vvSlicerManager::SetColorLevel(double s)\r
-{ //out << __func__ << endl;\r
+{ \r
for ( unsigned int i = 0; i < mSlicers.size(); i++) {\r
mSlicers[i]->SetColorLevel(s);\r
}\r
\r
//----------------------------------------------------------------------------\r
void vvSlicerManager::SetOverlayColorWindow(double s)\r
-{ //out << __func__ << endl;\r
+{ \r
for ( unsigned int i = 0; i < mSlicers.size(); i++) {\r
mSlicers[i]->SetOverlayColorWindow(s);\r
}\r
\r
//----------------------------------------------------------------------------\r
void vvSlicerManager::SetOverlayColorLevel(double s)\r
-{ //out << __func__ << endl;\r
+{ \r
for ( unsigned int i = 0; i < mSlicers.size(); i++) {\r
mSlicers[i]->SetOverlayColorLevel(s);\r
}\r
\r
//----------------------------------------------------------------------------\r
void vvSlicerManager::SetLinkOverlayWindowLevel(bool b)\r
-{ //out << __func__ << endl;\r
+{ \r
for ( unsigned int i = 0; i < mSlicers.size(); i++) {\r
mSlicers[i]->SetLinkOverlayWindowLevel(b);\r
}\r
\r
//----------------------------------------------------------------------------\r
void vvSlicerManager::SetCursorAndCornerAnnotationVisibility(int s)\r
-{ //out << __func__ << endl;\r
+{ \r
for ( unsigned int i = 0; i < mSlicers.size(); i++) {\r
mSlicers[i]->SetCursorVisibility(s);\r
mSlicers[i]->SetCornerAnnotationVisibility(s);\r
\r
//----------------------------------------------------------------------------\r
void vvSlicerManager::SetOpacity(int i, double factor)\r
-{ //out << __func__ << endl;\r
+{ \r
mSlicers[i]->SetOpacity(1/factor);\r
}\r
//----------------------------------------------------------------------------\r
\r
//----------------------------------------------------------------------------\r
void vvSlicerManager::UpdateViews(int current,int slicer)\r
-{ //out << __func__ << endl;\r
+{ \r
double p[3], pt[3];\r
p[0] = mSlicers[slicer]->GetCurrentPosition()[0];\r
p[1] = mSlicers[slicer]->GetCurrentPosition()[1];\r
\r
//----------------------------------------------------------------------------\r
void vvSlicerManager::UpdateLinked(int slicer)\r
-{ //out << __func__ << endl;\r
+{ \r
double p[3], pt[3];\r
p[0] = mSlicers[slicer]->GetCurrentPosition()[0];\r
p[1] = mSlicers[slicer]->GetCurrentPosition()[1];\r
\r
//----------------------------------------------------------------------------\r
void vvSlicerManager::UpdateLinkedNavigation(vvSlicer *refSlicer, bool bPropagate)\r
-{ //out << __func__ << endl;\r
+{ \r
vtkCamera *refCam = refSlicer->GetRenderer()->GetActiveCamera();\r
\r
double refPosition[3];\r
\r
//----------------------------------------------------------------------------\r
double vvSlicerManager::GetColorWindow() const\r
-{ //out << __func__ << endl;\r
+{ \r
if (mSlicers.size())\r
return mSlicers[0]->GetColorWindow();\r
return -1;\r
\r
//----------------------------------------------------------------------------\r
double vvSlicerManager::GetColorLevel() const\r
-{ //out << __func__ << endl;\r
+{ \r
if (mSlicers.size())\r
return mSlicers[0]->GetColorLevel();\r
return -1;\r
\r
//----------------------------------------------------------------------------\r
double vvSlicerManager::GetOverlayColorWindow() const\r
-{ //out << __func__ << endl;\r
+{ \r
if (mSlicers.size())\r
return mSlicers[0]->GetOverlayColorWindow();\r
return -1;\r
\r
//----------------------------------------------------------------------------\r
double vvSlicerManager::GetOverlayColorLevel() const\r
-{ //out << __func__ << endl;\r
+{ \r
if (mSlicers.size())\r
return mSlicers[0]->GetOverlayColorLevel();\r
return -1;\r
\r
//----------------------------------------------------------------------------\r
bool vvSlicerManager::GetLinkOverlayWindowLevel() const\r
-{ //out << __func__ << endl;\r
+{ \r
if (mSlicers.size())\r
return mSlicers[0]->GetLinkOverlayWindowLevel();\r
return -1;\r
\r
//------------------------------------------------------------------------------\r
void vvSlicerManager::ResetTransformationToIdentity(const std::string actorType)\r
-{ //out << __func__ << endl;\r
+{ \r
if(actorType == "image")\r
for(unsigned int i=0; i<this->GetImage()->GetTransform().size(); i++)\r
this->GetImage()->GetTransform()[i]->Identity();\r
\r
//----------------------------------------------------------------------------\r
void vvSlicerManager::Render()\r
-{ //out << __func__ << endl;\r
+{ \r
for ( unsigned int i = 0; i < mSlicers.size(); i++) {\r
mSlicers[i]->Render();\r
}\r
\r
//----------------------------------------------------------------------------\r
void vvSlicerManager::GenerateDefaultLookupTable()\r
-{ //out << __func__ << endl;\r
+{ \r
SetPreset(mPreset);\r
SetColorMap(mColorMap);\r
}\r
\r
//----------------------------------------------------------------------------\r
void vvSlicerManager::Reload()\r
-{ //out << __func__ << endl;\r
+{ \r
mReader->Update(mType);\r
mImage=mReader->GetOutput();\r
for ( unsigned int i = 0; i < mSlicers.size(); i++) {\r
\r
//----------------------------------------------------------------------------\r
void vvSlicerManager::ReloadFusion()\r
-{ //out << __func__ << endl;\r
+{ \r
mFusionReader->Update(mImage->GetNumberOfDimensions(),mFusionComponent.c_str(),mType);\r
\r
for ( unsigned int i = 0; i < mSlicers.size(); i++) {\r
//----------------------------------------------------------------------------\r
//the secondary sequence is being reloaded.\r
void vvSlicerManager::ReloadFusionSequence()\r
-{ //out << __func__ << endl;\r
+{ \r
// this is to keep the slice thickness, which needs to be artificially increased for visualization\r
double sp_x, sp_y, sp_z;\r
this->GetImage()->GetVTKImages()[0]->GetSpacing(sp_x, sp_y, sp_z);\r
\r
//----------------------------------------------------------------------------\r
void vvSlicerManager::ReloadOverlay()\r
-{ //out << __func__ << endl;\r
+{ \r
mOverlayReader->Update(mImage->GetNumberOfDimensions(),mOverlayComponent.c_str(),mType);\r
for ( unsigned int i = 0; i < mSlicers.size(); i++) {\r
mSlicers[i]->SetOverlay(mOverlayReader->GetOutput());\r
\r
//----------------------------------------------------------------------------\r
void vvSlicerManager::ReloadVF()\r
-{ //out << __func__ << endl;\r
+{ \r
mVectorReader->Update(vvImageReader::VECTORFIELD); //deletes the old images through the VF::Init() function\r
mVF=mVectorReader->GetOutput();\r
for ( unsigned int i = 0; i < mSlicers.size(); i++) {\r
\r
//----------------------------------------------------------------------------\r
void vvSlicerManager::RemoveActor(const std::string& actor_type, int overlay_index)\r
-{ //out << __func__ << endl;\r
+{ \r
if (actor_type =="overlay")\r
mOverlayReader = NULL;\r
\r
\r
//----------------------------------------------------------------------------\r
void vvSlicerManager::RemoveActors()\r
-{ //out << __func__ << endl;\r
+{ \r
///This method leaks a few objects. See RemoveActor for what a\r
///correct implementation would look like\r
//DS -> probably due to the reader (now released in the\r
\r
//----------------------------------------------------------------------------\r
void vvSlicerManager::UpdateInfoOnCursorPosition(int slicer)\r
-{ //out << __func__ << endl;\r
+{ \r
// int view = mSlicers[slicer]->GetSliceOrientation();\r
// int slice = mSlicers[slicer]->GetSlice();\r
double x = mSlicers[slicer]->GetCursorPosition()[0];\r
\r
//----------------------------------------------------------------------------\r
void vvSlicerManager::Activated()\r
-{ //out << __func__ << endl;\r
+{ \r
emit currentImageChanged(mId);\r
}\r
//----------------------------------------------------------------------------\r
\r
//----------------------------------------------------------------------------\r
void vvSlicerManager::Picked()\r
-{ //out << __func__ << endl;\r
+{ \r
emit currentPickedImageChanged(mId);\r
}\r
//----------------------------------------------------------------------------\r
\r
//----------------------------------------------------------------------------\r
void vvSlicerManager::UpdateWindowLevel()\r
-{ //out << __func__ << endl;\r
+{ \r
emit WindowLevelChanged();\r
}\r
//----------------------------------------------------------------------------\r
\r
//----------------------------------------------------------------------------\r
void vvSlicerManager::UpdateSlice(int slicer)\r
-{ //out << __func__ << endl;\r
+{ \r
if (mPreviousSlice[slicer] == mSlicers[slicer]->GetSlice()) {\r
//DD("============= NOTHING");\r
return;\r
\r
//----------------------------------------------------------------------------\r
void vvSlicerManager::UpdateTSlice(int slicer)\r
-{ //out << __func__ << endl;\r
+{ \r
int slice = mSlicers[slicer]->GetSlice();\r
\r
int tslice = mSlicers[slicer]->GetMaxCurrentTSlice();\r
\r
//----------------------------------------------------------------------------\r
void vvSlicerManager::UpdateSliceRange(int slicer)\r
-{ //out << __func__ << endl;\r
+{ \r
emit UpdateSliceRange(slicer,\r
mSlicers[slicer]->GetSliceRange()[0], mSlicers[slicer]->GetSliceRange()[1],\r
0,mSlicers[slicer]->GetTMax());\r
\r
//----------------------------------------------------------------------------\r
void vvSlicerManager::SetSlicingPreset(SlicingPresetType preset)\r
-{ //out << __func__ << endl;\r
+{ \r
if(mSlicingPreset==preset)\r
return;\r
\r
\r
//----------------------------------------------------------------------------\r
void vvSlicerManager::SetPreset(int preset)\r
-{ //out << __func__ << endl;\r
+{ \r
\r
//vtkLookupTable* LUT = static_cast<vtkLookupTable*>(mSlicers[0]->GetWindowLevel()->GetLookupTable());\r
double window = mSlicers[0]->GetColorWindow();\r
\r
//----------------------------------------------------------------------------\r
void vvSlicerManager::SetLocalColorWindowing(const int slicer, const bool bCtrlKey)\r
-{ //out << __func__ << endl;\r
+{ \r
double min, max;\r
if(bCtrlKey && this->mSlicers[slicer]->GetFusion()) {\r
int t = mSlicers[slicer]->GetFusionTSlice();\r
\r
//----------------------------------------------------------------------------\r
void vvSlicerManager::SetColorMap(int colormap)\r
-{ //out << __func__ << endl;\r
+{ \r
double range[2];\r
\r
range[0] = mSlicers[0]->GetInput()->GetScalarRange()[0];\r
\r
//----------------------------------------------------------------------------\r
vvLandmarks* vvSlicerManager::GetLandmarks()\r
-{ //out << __func__ << endl;\r
+{ \r
if (mLandmarks == NULL) {\r
mLandmarks = new vvLandmarks(mSlicers[0]->GetTMax()+1);\r
for (unsigned int i = 0; i < mSlicers.size(); i++)\r
\r
//----------------------------------------------------------------------------\r
void vvSlicerManager::AddLandmark(float x,float y,float z,float t)\r
-{ //out << __func__ << endl;\r
+{ \r
double x_index = (x - mSlicers[0]->GetInput()->GetOrigin()[0])/mSlicers[0]->GetInput()->GetSpacing()[0];\r
double y_index = (y - mSlicers[0]->GetInput()->GetOrigin()[1])/mSlicers[0]->GetInput()->GetSpacing()[1];\r
double z_index = (z - mSlicers[0]->GetInput()->GetOrigin()[2])/mSlicers[0]->GetInput()->GetSpacing()[2];\r
\r
//----------------------------------------------------------------------------\r
void vvSlicerManager::PrevImage(int slicer)\r
-{ //out << __func__ << endl;\r
+{ \r
emit ChangeImageWithIndexOffset(this, slicer, -1);\r
}\r
//----------------------------------------------------------------------------\r
\r
//----------------------------------------------------------------------------\r
void vvSlicerManager::NextImage(int slicer)\r
-{ //out << __func__ << endl;\r
+{ \r
emit ChangeImageWithIndexOffset(this, slicer, 1);\r
}\r
//----------------------------------------------------------------------------\r
\r
//----------------------------------------------------------------------------\r
void vvSlicerManager::VerticalSliderHasChanged(int slicer, int slice)\r
-{ //out << __func__ << endl;\r
+{ \r
emit AVerticalSliderHasChanged(slicer, slice);\r
}\r
\r
\r
//----------------------------------------------------------------------------\r
double vvSlicerManager::GetScalarComponentAsDouble(vtkImageData *image, double X, double Y, double Z, int component)\r
-{ //out << __func__ << endl;\r
+{ \r
int ix, iy, iz;\r
return mSlicers[0]->GetScalarComponentAsDouble(image, X, Y, Z, ix, iy, iz, component);\r
}\r
//------------------------------------------------------------------------------
void vvToolBinarize::Initialize()
-{ //out << __func__ << endl;
+{
SetToolName("Binarize");
SetToolMenuName("Binarize");
SetToolIconFilename(":/common/icons/binarize.png");
:vvToolWidgetBase(parent,f),
vvToolBase<vvToolBinarize>(parent),
Ui::vvToolBinarize()
-{ //out << __func__ << endl;
+{
// GUI Initialization
Ui_vvToolBinarize::setupUi(mToolWidget);
mInteractiveDisplayIsEnabled = mCheckBoxInteractiveDisplay->isChecked();
//------------------------------------------------------------------------------
vvToolBinarize::~vvToolBinarize()
-{ //out << __func__ << endl;
+{
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
void vvToolBinarize::InteractiveDisplayToggled(bool b)
-{ //out << __func__ << endl;
+{
mInteractiveDisplayIsEnabled = b;
if (!mInteractiveDisplayIsEnabled) {
RemoveVTKObjects();
//------------------------------------------------------------------------------
void vvToolBinarize::RemoveVTKObjects()
-{ //out << __func__ << endl;
+{
for(unsigned int i=0; i<mImageContour.size(); i++) {
mImageContour[i]->HideActors();
mImageContourLower[i]->HideActors();
//------------------------------------------------------------------------------
bool vvToolBinarize::close()
-{ //out << __func__ << endl;
+{
// RemoveVTKObjects();
return vvToolWidgetBase::close();
}
//------------------------------------------------------------------------------
void vvToolBinarize::closeEvent(QCloseEvent *event)
-{ //out << __func__ << endl;
+{
RemoveVTKObjects();
event->accept();
}
//------------------------------------------------------------------------------
void vvToolBinarize::reject()
-{ //out << __func__ << endl;
+{
// DD("vvToolBinarize::reject");
RemoveVTKObjects();
return vvToolWidgetBase::reject();
//------------------------------------------------------------------------------
void vvToolBinarize::enableLowerThan(bool b)
-{ //out << __func__ << endl;
+{
if (!b) {
mThresholdSlider1->resetMaximum();
for(unsigned int i=0; i<mImageContour.size(); i++) {
//------------------------------------------------------------------------------
void vvToolBinarize::useFGBGtoggled(bool)
-{ //out << __func__ << endl;
+{
if (!mCheckBoxUseBG->isChecked() && !mCheckBoxUseFG->isChecked())
mCheckBoxUseBG->toggle();
}
// DD(m.size());
// }
void vvToolBinarize::InputIsSelected(vvSlicerManager * m)
-{ //out << __func__ << endl;
+{
mCurrentSlicerManager = m;
// Specific for this gui
//------------------------------------------------------------------------------
void vvToolBinarize::UpdateOrientation(int slicer,int orientation)
-{ //out << __func__ << endl;
+{
Update(slicer);
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
void vvToolBinarize::UpdateSlice(int slicer,int slices)
-{ //out << __func__ << endl;
+{
Update(slicer);
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
void vvToolBinarize::Update(int slicer)
-{ //out << __func__ << endl;
+{
if (!mInteractiveDisplayIsEnabled) return;
if (!mCurrentSlicerManager) close();
mImageContour[slicer]->Update(mThresholdSlider1->GetValue());
//------------------------------------------------------------------------------
void vvToolBinarize::GetArgsInfoFromGUI()
-{ //out << __func__ << endl;
+{
/* //KEEP THIS FOR READING GGO FROM FILE
int argc=1;
//------------------------------------------------------------------------------
void vvToolBinarize::apply()
-{ //out << __func__ << endl;
+{
if (!mCurrentSlicerManager) close();
QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
GetArgsInfoFromGUI();
//------------------------------------------------------------------------------
void vvToolBinarize::valueChangedT2(double v)
-{ //out << __func__ << endl;
+{
// DD("valueChangedT2");
if (mRadioButtonLowerThan->isChecked()) {
mThresholdSlider1->SetMaximum(v);
//------------------------------------------------------------------------------
void vvToolBinarize::valueChangedT1(double v)
-{ //out << __func__ << endl;
+{
// DD("valueChangedT1");
if (!mCurrentSlicerManager) close();
mThresholdSlider2->SetMinimum(v);
QWidget(parent->GetTab()),
vvToolBase<vvToolROIManager>(parent),
Ui::vvToolROIManager()
-{ //out << __func__ << endl;
+{
// Store parent
mMainWindow = parent;
//------------------------------------------------------------------------------
vvToolROIManager::~vvToolROIManager()
-{ //out << __func__ << endl;
+{
mROIActorsList.clear();
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
// STATIC
void vvToolROIManager::Initialize()
-{ //out << __func__ << endl;
+{
SetToolName("ROIManager");
SetToolMenuName("Open ROI (binary image or RT-STRUCT)");
SetToolIconFilename(":/common/icons/tool-roi.png");
//------------------------------------------------------------------------------
void vvToolROIManager::InitializeNewTool(bool ReadStateFlag)
-{ //out << __func__ << endl;
+{
// Check if we need to start a new tool or read in the state file to load
if (ReadStateFlag == false) {
// Select the current image as the target
//------------------------------------------------------------------------------
void vvToolROIManager::InputIsSelected(vvSlicerManager *m)
-{ //out << __func__ << endl;
+{
// Initialization
mCurrentSlicerManager = m;
mCurrentImage = mCurrentSlicerManager->GetImage();
//------------------------------------------------------------------------------
void vvToolROIManager::AnImageIsBeingClosed(vvSlicerManager * m)
-{ //out << __func__ << endl;
+{
if (m == mCurrentSlicerManager) {
close();
return;
//------------------------------------------------------------------------------
void vvToolROIManager::close()
-{ //out << __func__ << endl;
+{
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)));
//------------------------------------------------------------------------------
void vvToolROIManager::SelectedImageHasChanged(vvSlicerManager * m)
-{ //out << __func__ << endl;
+{
if (mCurrentSlicerManager == NULL) return;
if (m == NULL) return;
if (m != mCurrentSlicerManager) hide();
//------------------------------------------------------------------------------
void vvToolROIManager::Open()
-{ //out << __func__ << endl;
+{
// Open images
QString Extensions = "Images or Dicom-Struct files ( *.mha *.mhd *.hdr *.his *.dcm RS*)";
Extensions += ";;All Files (*)";
//------------------------------------------------------------------------------
void vvToolROIManager::OpenBinaryImage(QStringList & filename)
-{ //out << __func__ << endl;
+{
if (filename.size() == 0) return;
vvProgressDialog p("Reading ROI ...", true);
//------------------------------------------------------------------------------
void vvToolROIManager::OpenDicomImage(std::string filename)
-{ //out << __func__ << endl;
+{
// GUI selector of roi
vvMeshReader reader;
reader.SetFilename(filename);
std::string name,
std::string filename,
double BG, bool modeBG)
-{ //out << __func__ << endl;
+{
// Check Dimension
int dim = mCurrentImage->GetNumberOfDimensions();
int bin_dim = binaryImage->GetNumberOfDimensions();
//------------------------------------------------------------------------------
void vvToolROIManager::UpdateAllContours()
-{ //out << __func__ << endl;
+{
if (mCurrentSlicerManager == NULL) return;
// Render loaded ROIs (the first is sufficient)
for(unsigned int i=0; i<mROIList.size(); i++) {
//------------------------------------------------------------------------------
void vvToolROIManager::UpdateAllROIStatus()
-{ //out << __func__ << endl;
+{
int nbVisible = 0;
int nb = mROIList.size();
for(int i=0; i<nb; i++) {
//------------------------------------------------------------------------------
void vvToolROIManager::SelectedItemChangedInTree()
-{ //out << __func__ << endl;
+{
// Search which roi is selected
QList<QTreeWidgetItem *> l = mTree->selectedItems();
if (l.size() == 0) {
//------------------------------------------------------------------------------
void vvToolROIManager::VisibleROIToggled(bool b)
-{ //out << __func__ << endl;
+{
if (mCurrentROIActor == NULL) return;
if (b == mCurrentROIActor->IsVisible()) return; // nothing to do
mCurrentROIActor->SetVisible(b);
//------------------------------------------------------------------------------
void vvToolROIManager::VisibleContourROIToggled(bool b)
-{ //out << __func__ << endl;
+{
if (mCurrentROIActor == NULL) return;
if (mCurrentROIActor->IsContourVisible() == b) return; // nothing to do
mCurrentROIActor->SetContourVisible(b);
//------------------------------------------------------------------------------
void vvToolROIManager::OpacityChanged(int v)
-{ //out << __func__ << endl;
+{
if (mCurrentROIActor == NULL) return;
mCurrentROIActor->SetOpacity((double)v/100.0);
mCurrentROIActor->UpdateColor();
//------------------------------------------------------------------------------
void vvToolROIManager::AllVisibleROIToggled(int b)
-{ //out << __func__ << endl;
+{
bool status = false;
if ((mCheckBoxShowAll->checkState() == Qt::Checked) ||
(mCheckBoxShowAll->checkState() == Qt::PartiallyChecked)) status = true;
//------------------------------------------------------------------------------
void vvToolROIManager::AllVisibleContourROIToggled(bool b)
-{ //out << __func__ << endl;
+{
bool status = false;
if ((mContourCheckBoxShowAll->checkState() == Qt::Checked) ||
(mContourCheckBoxShowAll->checkState() == Qt::PartiallyChecked)) status = true;
//------------------------------------------------------------------------------
void vvToolROIManager::ChangeColor()
-{ //out << __func__ << endl;
+{
if (mCurrentROIActor == NULL) return;
QColor color;
color.setRgbF(mCurrentROIActor->GetROI()->GetDisplayColor()[0],
//------------------------------------------------------------------------------
void vvToolROIManager::ChangeContourColor()
-{ //out << __func__ << endl;
+{
if (mCurrentROIActor == NULL) return;
QColor color;
color.setRgbF(mCurrentROIActor->GetContourColor()[0],
//------------------------------------------------------------------------------
void vvToolROIManager::ChangeContourWidth(int n)
-{ //out << __func__ << endl;
+{
if (mCurrentROIActor == NULL) return;
mCurrentROIActor->SetContourWidth(n);
mCurrentROIActor->UpdateColor();
//------------------------------------------------------------------------------
void vvToolROIManager::ChangeDepth(int n)
-{ //out << __func__ << endl;
+{
if (mCurrentROIActor == NULL) return;
mCurrentROIActor->SetDepth(n);
// mCurrentROIActor->UpdateImage(); // FIXME
//------------------------------------------------------------------------------
void vvToolROIManager::ReloadCurrentROI()
-{ //out << __func__ << endl;
+{
if (mCurrentROI->GetFilename() == "") {
return; // do nothing (contour from rt struct do not reload)
}
//------------------------------------------------------------------------------
void vvToolROIManager::SaveState(std::auto_ptr<QXmlStreamWriter> & m_XmlWriter)
-{ //out << __func__ << endl;
+{
// Get index of the image
int n = mMainWindow->GetSlicerManagers().size();
int index=-1;
//------------------------------------------------------------------------------
void vvToolROIManager::ReadXMLInformation()
-{ //out << __func__ << endl;
+{
std::string value="";
mInitialImageIndex = -1;
while (!(m_XmlReader->isEndElement() && value == GetToolName().toStdString())) {
//------------------------------------------------------------------------------
void vvToolROIManager::ReadXMLInformation_ROI()
-{ //out << __func__ << endl;
+{
QString s;
std::string value="";
QSharedPointer<vvROIActor> param = QSharedPointer<vvROIActor>(new vvROIActor);
vvToolWidgetBase::vvToolWidgetBase(vvMainWindowBase * parent, Qt::WindowFlags f, bool initialize):
QWidget(parent, f),
Ui::vvToolWidgetBase()
-{ //out << __func__ << endl;
+{
mMainWindow = parent;
setAttribute(Qt::WA_DeleteOnClose);
if (initialize) Initialization();
//------------------------------------------------------------------------------
void vvToolWidgetBase::Initialization()
-{ //out << __func__ << endl;
+{
mCurrentSlicerManager = 0;
mIsInitialized = false;
mFilter = 0;
//------------------------------------------------------------------------------
vvToolWidgetBase::~vvToolWidgetBase()
-{ //out << __func__ << endl;
+{
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
void vvToolWidgetBase::keyPressEvent(QKeyEvent *event)
-{ //out << __func__ << endl;
+{
if (event->key() == Qt::Key_Escape) {
reject();
event->accept();
//------------------------------------------------------------------------------
void vvToolWidgetBase::accept()
-{ //out << __func__ << endl;
+{
apply();
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
void vvToolWidgetBase::reject()
-{ //out << __func__ << endl;
+{
close();
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
void vvToolWidgetBase::AddInputSelector(QString s, clitk::ImageToImageGenericFilterBase * f, bool allowSkip)
-{ //out << __func__ << endl;
+{
int j=0;
mFilter = f;
mSlicerManagersCompatible.clear();
//------------------------------------------------------------------------------
void vvToolWidgetBase::AddInputSelector(QString s, bool allowSkip)
-{ //out << __func__ << endl;
+{
mSlicerManagersCompatible.clear();
for(unsigned int i=0; i<mMainWindow->GetSlicerManagers().size(); i++) {
mSlicerManagersCompatible.push_back(mMainWindow->GetSlicerManagers()[i]);
//------------------------------------------------------------------------------
void vvToolWidgetBase::HideInputSelector()
-{ //out << __func__ << endl;
+{
mToolInputSelectionWidget->hide();
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
void vvToolWidgetBase::show()
-{ //out << __func__ << endl;
+{
if (!mIsInitialized) {
mToolInputSelectionWidget->Initialize();
mIsInitialized = true;
//------------------------------------------------------------------------------
void vvToolWidgetBase::closeEvent(QCloseEvent *event)
-{ //out << __func__ << endl;
+{
mIsAnotherToolWaitInput = false;
if (isWindow()) {
event->accept();//return QWidget::close();
//------------------------------------------------------------------------------
bool vvToolWidgetBase::close()
-{ //out << __func__ << endl;
+{
QApplication::restoreOverrideCursor();
return QWidget::close();
}
//------------------------------------------------------------------------------
void vvToolWidgetBase::AnImageIsBeingClosed(vvSlicerManager * m)
-{ //out << __func__ << endl;
+{
mToolInputSelectionWidget->AnImageIsBeingClosed(m);
if (m == mCurrentSlicerManager) {
close();
//------------------------------------------------------------------------------
void vvToolWidgetBase::SwapCurrentWidget()
-{ //out << __func__ << endl;
+{
mStaticWidgetForTab->setUpdatesEnabled(false);
QList<QObject*> l =mStaticWidgetForTab->children();
for(int i=1; i<l.size(); i++) {
//------------------------------------------------------------------------------
void vvToolWidgetBase::SelectedImageHasChanged(vvSlicerManager * m)
-{ //out << __func__ << endl;
+{
if (!isWindow()) { // When the tool is not in a window, it is in a tab : we only display if needed
if (mCurrentSlicerManager == NULL) return;
if (mToolWidget == NULL) return;
//------------------------------------------------------------------------------
void vvToolWidgetBase::InitializeInputs()
-{ //out << __func__ << endl;
+{
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
void vvToolWidgetBase::InputIsSelected()
-{ //out << __func__ << endl;
+{
mMainButtonBox->setEnabled(true);
std::vector<vvSlicerManager*> & l = mToolInputSelectionWidget->GetSelectedInputs();
mCurrentSlicerManager = l[0];
//------------------------------------------------------------------------------
void vvToolWidgetBase::InputIsSelected(vvSlicerManager * m)
-{ //out << __func__ << endl;
+{
std::cerr << "You MUST overwrite this method vvToolWidgetBase::InputIsSelected(vvSlicerManager * m) if you use one single input" << std::endl;
exit(0);
}
//------------------------------------------------------------------------------
void vvToolWidgetBase::InputIsSelected(std::vector<vvSlicerManager*> & l)
-{ //out << __func__ << endl;
+{
mMainButtonBox->setEnabled(true);
if (l.size() == 1) InputIsSelected(l[0]);
else {