X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=vv%2FvvSegmentationDialog.cxx;h=888375eefbb2449001e80dd5300998298e421894;hb=a6957c4825e83c61b977ec316dd841878617ffbd;hp=915a281354355cb50be6150349c40e50a637b8ff;hpb=1e034c70105f0926939acaaa27ddb46e904ae8bf;p=clitk.git diff --git a/vv/vvSegmentationDialog.cxx b/vv/vvSegmentationDialog.cxx index 915a281..888375e 100644 --- a/vv/vvSegmentationDialog.cxx +++ b/vv/vvSegmentationDialog.cxx @@ -3,7 +3,7 @@ Authors belong to: - University of LYON http://www.universite-lyon.fr/ - - Léon Bérard cancer center http://oncora1.lyon.fnclcc.fr + - Léon Bérard cancer center http://www.centreleonberard.fr - CREATIS CNRS laboratory http://www.creatis.insa-lyon.fr This software is distributed WITHOUT ANY WARRANTY; without even @@ -14,7 +14,7 @@ - BSD See included LICENSE.txt file - CeCILL-B http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html -======================================================================-====*/ +===========================================================================**/ #ifndef _vvSegmentationDialog_CXX #define _vvSegmentationDialog_CXX #include @@ -78,6 +78,7 @@ vvSegmentationDialog::vvSegmentationDialog(QWidget * parent, Qt::WindowFlags f) //m3DMapper = vtkPolyDataMapper::New(); //m3DActor = vtkActor::New(); m3DExtractor = vtkMarchingCubes::New(); + m3DExtractor->ComputeScalarsOff(); m3DMappers.clear(); m3DActors.clear(); @@ -412,9 +413,9 @@ void vvSegmentationDialog::InsertSeed() point4D[3] = mManager->GetLandmarks()->GetCoordinates( mManager->GetLandmarks()->GetNumberOfPoints()-1)[3]; - point4D[0] = point4D[0]/mManager->GetSlicer(0)->GetImage()->GetVTKImages()[0]->GetSpacing()[0]; - point4D[1] = point4D[1]/mManager->GetSlicer(0)->GetImage()->GetVTKImages()[0]->GetSpacing()[1]; - point4D[2] = point4D[2]/mManager->GetSlicer(0)->GetImage()->GetVTKImages()[0]->GetSpacing()[2]; + point4D[0] = (point4D[0]-mManager->GetSlicer(0)->GetImage()->GetVTKImages()[0]->GetOrigin()[0])/mManager->GetSlicer(0)->GetImage()->GetVTKImages()[0]->GetSpacing()[0]; + point4D[1] = (point4D[1]-mManager->GetSlicer(0)->GetImage()->GetVTKImages()[0]->GetOrigin()[1])/mManager->GetSlicer(0)->GetImage()->GetVTKImages()[0]->GetSpacing()[1]; + point4D[2] = (point4D[2]-mManager->GetSlicer(0)->GetImage()->GetVTKImages()[0]->GetOrigin()[2])/mManager->GetSlicer(0)->GetImage()->GetVTKImages()[0]->GetSpacing()[2]; vtkImageSeedConnectivity* seed = vtkImageSeedConnectivity::New(); seed->SetInputConnectValue(1); @@ -512,20 +513,24 @@ void vvSegmentationDialog::Save() int dimension = mManager->GetDimension(); if (dimension == 1) { OutputListeFormat.push_back(".mhd"); + OutputListeFormat.push_back(".mha"); } if (dimension == 2) { OutputListeFormat.push_back(".bmp"); OutputListeFormat.push_back(".png"); OutputListeFormat.push_back(".jpeg"); OutputListeFormat.push_back(".tif"); + OutputListeFormat.push_back(".mha"); OutputListeFormat.push_back(".mhd"); OutputListeFormat.push_back(".hdr"); OutputListeFormat.push_back(".vox"); } else if (dimension == 3) { + OutputListeFormat.push_back(".mha"); OutputListeFormat.push_back(".mhd"); OutputListeFormat.push_back(".hdr"); OutputListeFormat.push_back(".vox"); } else if (dimension == 4) { + OutputListeFormat.push_back(".mha"); OutputListeFormat.push_back(".mhd"); } QString Extensions = "AllFiles(*.*)"; @@ -545,7 +550,7 @@ void vvSegmentationDialog::Save() QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); vvProgressDialog progress("Saving "+fileName.toStdString()); qApp->processEvents(); - vvImageWriter *writer = new vvImageWriter; + vvImageWriter::Pointer writer = vvImageWriter::New(); writer->SetOutputFileName(fileName.toStdString()); writer->SetInput(mManager->GetSlicer(0)->GetImage()); writer->Update(dimension,"unsigned_char");