#=========================================================
# Find libstatgrab is installed, add clitkMemoryUsage.cxx in the library
-FIND_LIBRARY(LIBSTATGRAB NAMES statgrab PATHS)
-IF (${LIBSTATGRAB} MATCHES "LIBSTATGRAB-NOTFOUND")
+IF (NOT DEFINED CLITK_MEMORY_INFO OR CLITK_MEMORY_INFO)
+ FIND_LIBRARY(LIBSTATGRAB NAMES statgrab PATHS)
+ IF (${LIBSTATGRAB} MATCHES "LIBSTATGRAB-NOTFOUND")
# MESSAGE("Install libstatgrab (http://www.i-scream.org/libstatgrab/) for memory usage information")
- SET(CLITK_MEMORY_INFO OFF)
-ELSE (${LIBSTATGRAB} MATCHES "LIBSTATGRAB-NOTFOUND")
- SET(CLITK_MEMORY_INFO ON)
-ENDIF (${LIBSTATGRAB} MATCHES "LIBSTATGRAB-NOTFOUND")
+ SET(CLITK_MEMORY_INFO OFF)
+ ELSE (${LIBSTATGRAB} MATCHES "LIBSTATGRAB-NOTFOUND")
+ SET(CLITK_MEMORY_INFO ON)
+ ENDIF (${LIBSTATGRAB} MATCHES "LIBSTATGRAB-NOTFOUND")
+ENDIF()
#=========================================================
### Declare clitkCommon library
ADD_LIBRARY(clitkCommon STATIC ${clitkCommon_SRC})
-IF(NOT ${LIBSTATGRAB} MATCHES "LIBSTATGRAB-NOTFOUND")
+IF(CLITK_MEMORY_INFO)
TARGET_LINK_LIBRARIES(clitkCommon statgrab)
-ENDIF(NOT ${LIBSTATGRAB} MATCHES "LIBSTATGRAB-NOTFOUND")
+ENDIF(CLITK_MEMORY_INFO)
### Check if ITK was compiled with SYSTEM_GDCM = ON and set the gdcm libraries accordingly
SET(CLITK_USE_SYSTEM_GDCM FALSE)
/* PixelData */
#if GDCM_MAJOR_VERSION == 2
gdcm::Image &i = m_GdcmImageReader.GetImage();
- i.GetBuffer((char*)buffer);
- // WARNING: GetBuffer return the pixel values as stored on disk not the real pixel value
- // we still need to multiply by m_DoseScaling
- // An alternate solution would be to use vtkGDCMImageReader...
+
+ char* image_data = new char[i.GetBufferLength()];
+ i.GetBuffer(image_data);
+
+ gdcm::DataSet& ds = m_GdcmImageReader.GetFile().GetDataSet();
+ float *img = (float*) buffer;
+
+ gdcm::Attribute<0x28, 0x100> pixel_size;
+ pixel_size.SetFromDataSet(ds);
+ if (pixel_size.GetValue() == 16) {
+ unsigned short* image_data2 = (unsigned short*) image_data ;
+ dose_copy_raw (img, image_data2, npix, m_DoseScaling);
+ }
+ else if (pixel_size.GetValue() == 32) {
+ unsigned long* image_data2 = (unsigned long*) image_data;
+ dose_copy_raw (img, image_data2, npix, m_DoseScaling);
+ } else {
+ itkExceptionMacro(<< "Error RTDOSE not type 16U and 32U (type="
+ << pixel_size.GetValue() << ")");
+ }
+
+ delete [] image_data;
#else
float *img = (float*) buffer;
#include "clitkUSVoxImageIOFactory.h"
#include "clitkSvlImageIOFactory.h"
#endif
+#if ITK_VERSION_MAJOR >= 4
+ #include "itkGDCMImageIOFactory.h"
+#endif
//--------------------------------------------------------------------
// Register factories
void clitk::RegisterClitkFactories()
{
+#if ITK_VERSION_MAJOR >= 4
+ std::list< itk::ObjectFactoryBase * > fl = itk::GDCMImageIOFactory::GetRegisteredFactories();
+ for (std::list< itk::ObjectFactoryBase * >::iterator it = fl.begin(); it != fl.end(); ++it)
+ if (dynamic_cast<itk::GDCMImageIOFactory *>(*it))
+ {
+ itk::GDCMImageIOFactory::UnRegisterFactory(*it);
+ break;
+ }
+#endif
#if CLITK_PRIVATE_FEATURES
clitk::UsfImageIOFactory::RegisterOneFactory();
clitk::USVoxImageIOFactory::RegisterOneFactory();
rtk::EdfImageIOFactory::RegisterOneFactory();
rtk::ImagXImageIOFactory::RegisterOneFactory();
clitk::EsrfHstImageIOFactory::RegisterOneFactory();
+#if ITK_VERSION_MAJOR >= 4
+ itk::GDCMImageIOFactory::RegisterOneFactory();
+#endif
} ////
TARGET_LINK_LIBRARIES(clitkConvertBSplineDeformableTransformToVF clitkCommon ${ITK_LIBRARIES})
SET(REGISTRATION_INSTALL ${REGISTRATION_INSTALL} clitkConvertBSplineDeformableTransformToVF)
-# SET_TARGET_PROPERTIES(${REGISTRATION_INSTALL} PROPERTIES INSTALL_RPATH "${VTK_DIR}:${ITK_DIR}" )
INSTALL (TARGETS ${REGISTRATION_INSTALL} DESTINATION bin PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_EXECUTE WORLD_EXECUTE)
ENDIF(CLITK_BUILD_REGISTRATION)
ADD_EXECUTABLE(clitkRegionGrowing clitkRegionGrowing.cxx ${clitkRegionGrowing_GGO_C} ${clitkRelativePosition_GGO_C})
TARGET_LINK_LIBRARIES(clitkRegionGrowing clitkCommon ${ITK_LIBRARIES})
-# SET_TARGET_PROPERTIES(${SEGMENTATION_INSTALL} PROPERTIES INSTALL_RPATH "${VTK_DIR}:${ITK_DIR}" )
INSTALL (TARGETS ${SEGMENTATION_INSTALL} DESTINATION bin PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_EXECUTE WORLD_EXECUTE)
ENDIF(CLITK_BUILD_SEGMENTATION)
section "Input"
-option "input" i "Input grid filename" string yes
-option "output" o "Output grid filename" string yes
+option "input" i "Input image filename" string yes
+option "output" o "Output image filename" string yes
section "Processing Parameters"
-no-libtiff
-no-libjpeg
-no-libmng
+ -no-glib
INSTALL_COMMAND ""
)
SET(qmake_executable "${build_prefix}/QT/bin/qmake")
TARGET_LINK_LIBRARIES(clitkTransformLandmarks clitkCommon ${ITK_LIBRARIES})
SET(TOOLS_INSTALL ${TOOLS_INSTALL} clitkTransformLandmarks)
+ WRAP_GGO(clitkMaskLandmarks_GGO_C clitkMaskLandmarks.ggo)
+ ADD_EXECUTABLE(clitkMaskLandmarks clitkMaskLandmarks.cxx ${clitkMaskLandmarks_GGO_C})
+ TARGET_LINK_LIBRARIES(clitkMaskLandmarks clitkCommon ${ITK_LIBRARIES})
+ SET(TOOLS_INSTALL ${TOOLS_INSTALL} clitkMaskLandmarks)
+
ADD_EXECUTABLE(clitkMakeSphereImage clitkMakeSphereImage.cxx) # clitkLineProfileGenericFilter.cxx ${clitkLineProfile_GGO_C})
TARGET_LINK_LIBRARIES(clitkMakeSphereImage clitkCommon ${ITK_LIBRARIES})
SET(TOOLS_INSTALL ${TOOLS_INSTALL} clitkMakeSphereImage)
SET(TOOLS_INSTALL ${TOOLS_INSTALL} clitkDicomRTPlan2Gate)
ENDIF(ITK_VERSION_MAJOR VERSION_LESS 4)
-# SET_TARGET_PROPERTIES(${TOOLS_INSTALL} PROPERTIES INSTALL_RPATH "${VTK_DIR}:${ITK_DIR}" )
INSTALL (TARGETS ${TOOLS_INSTALL} DESTINATION bin PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
ENDIF(CLITK_BUILD_TOOLS)
--- /dev/null
+/*=========================================================================
+ Program: vv http://www.creatis.insa-lyon.fr/rio/vv
+
+ Authors belong to:
+ - University of LYON http://www.universite-lyon.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
+ the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ PURPOSE. See the copyright notices for more information.
+
+ It is distributed under dual licence
+
+ - BSD See included LICENSE.txt file
+ - CeCILL-B http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
+===========================================================================*/
+#include "clitkMaskLandmarks_ggo.h"
+
+#include <string>
+#include <vector>
+#include <iostream>
+#include <fstream>
+
+#include <clitkCommon.h>
+#include <clitkImageCommon.h>
+
+typedef itk::Point<double, 3> PointType;
+typedef std::vector<PointType> PointArrayType;
+
+static void read_points_pts(const std::string& fileName, PointArrayType& points, bool verbose)
+{
+ std::ifstream landmarksFile(fileName.c_str());
+ if (landmarksFile.fail())
+ {
+ std::cerr << "ERROR: could not open '" << fileName << "'" << std::endl;
+ exit(-2);
+ }
+
+ std::string line;
+ std::getline(landmarksFile, line);
+ if (line.find("#X") != 0)
+ {
+ std::cerr << "ERROR: invalid landmarks file '" << fileName << "'" << std::endl;
+ exit(-3);
+ }
+
+ PointType p;
+ while (!landmarksFile.eof())
+ {
+ landmarksFile >> p[0] >> p[1] >> p[2];
+ if (landmarksFile.fail())
+ break;
+ if (verbose)
+ std::cout << "point " << p << std::endl;
+ points.push_back(p);
+ }
+}
+
+void write_points_pts(const std::string& fileName, const PointArrayType& points, bool verbose)
+{
+ std::ofstream landmarksFile(fileName.c_str());
+
+ landmarksFile << "#X\tY\tZ" << std::endl;
+ for (size_t i = 0; i < points.size(); i++)
+ landmarksFile << points[i][0] << "\t" << points[i][1] << "\t" << points[i][2] << "\t" << std::endl;
+}
+
+int main(int argc, char** argv)
+{
+ typedef itk::Image<unsigned char, 3> MaskType;
+ typedef MaskType::Pointer MaskPointer;
+ GGO(clitkMaskLandmarks, args_info);
+
+ if (args_info.input_given != args_info.output_given)
+ {
+ std::cerr << "The number of inputs must be equal to the number of outputs" << std::endl;;
+ exit(1);
+ }
+
+ std::vector<PointArrayType> inputs(args_info.input_given);
+ for (unsigned i = 0; i < args_info.input_given; ++i)
+ {
+ read_points_pts(args_info.input_arg[i], inputs[i], args_info.verbose_flag);
+ if (inputs[i].size() != inputs[0].size())
+ {
+ std::cerr << "All input files must contain the same amount of points" << std::endl;
+ exit(2);
+ }
+ }
+
+ MaskPointer mask = clitk::readImage<MaskType>(args_info.mask_arg, args_info.verbose_flag);
+ std::vector<PointArrayType> outputs(args_info.input_given);
+ for (unsigned i = 0; i < inputs[0].size(); ++i)
+ {
+ MaskType::IndexType idx;
+ if (mask->TransformPhysicalPointToIndex(inputs[0][i], idx) && (*mask)[idx])
+ for (unsigned j = 0; j < args_info.input_given; j++)
+ outputs[j].push_back(inputs[j][i]);
+ }
+
+ for (unsigned i = 0; i < args_info.input_given; ++i)
+ write_points_pts(args_info.output_arg[i], outputs[i], args_info.verbose_flag);
+}
--- /dev/null
+package "clitkMaskLandmarks"
+version "1.0"
+purpose "Remove landmarks outside of a given mask also remove their corresponding points if multiple input are given."
+
+option "config" - "Config file" string no
+option "verbose" v "Verbose" flag off
+
+option "input" i "Input landmarks filename" string yes multiple
+option "mask" m "Input mask" string yes
+option "output" o "Output landmarks filename" string yes multiple
option "output" o "Output image filename" string yes
section "Used determined padding"
-option "lower" l "Size of the lower crop region (multiple values)" int no multiple
-option "upper" u "Size of the upper crop region (multiple values)" int no multiple
+option "lower" l "Size of the lower bound padding (multiple values=number of image dimension)" int no multiple
+option "upper" u "Size of the upper bound padding (multiple values=number of image dimension)" int no multiple
+
section "Pad like another image"
option "like" - "Pad like this image (must have the same spacing and bounding box must be larger)" string no
#=========================================================
# Install options (also used by CPack)
IF(UNIX OR APPLE)
-# SET_TARGET_PROPERTIES(vv
-# PROPERTIES INSTALL_RPATH "${VTK_DIR}:${ITK_DIR}")
INSTALL (TARGETS vv DESTINATION bin PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_EXECUTE WORLD_EXECUTE)
# INSTALL (FILES ${CMAKE_CURRENT_SOURCE_DIR}/icons/ducky.png DESTINATION .)
SET(CPACK_PACKAGE_VERSION_MAJOR "1")
SET(CPACK_PACKAGE_VERSION_MINOR "3")
SET(CPACK_PACKAGE_VERSION_PATCH "0")
-SET(CPACK_PACKAGE_INSTALL_DIRECTORY "vv")
+IF(NIGHTLY)
+ SET(CPACK_PACKAGE_INSTALL_DIRECTORY "vv-nightly")
+ELSE(NIGHTLY)
+ SET(CPACK_PACKAGE_INSTALL_DIRECTORY "vv")
+ENDIF(NIGHTLY)
SET(CPACK_STRIP_FILES TRUE)
IF(WIN32)
</sizepolicy>
</property>
<property name="currentIndex">
- <number>1</number>
+ <number>0</number>
</property>
<widget class="QWidget" name="DataTab">
<attribute name="title">
<rect>
<x>0</x>
<y>0</y>
- <width>444</width>
- <height>612</height>
+ <width>446</width>
+ <height>679</height>
</rect>
</property>
<property name="sizePolicy">
</property>
<property name="geometry">
<rect>
- <x>220</x>
+ <x>230</x>
<y>60</y>
- <width>80</width>
+ <width>91</width>
<height>17</height>
</rect>
</property>
<widget class="QCheckBox" name="fCTUSActivateSpaceSyncCheckBox">
<property name="geometry">
<rect>
- <x>220</x>
+ <x>270</x>
<y>10</y>
- <width>61</width>
+ <width>81</width>
<height>17</height>
</rect>
</property>
<rect>
<x>30</x>
<y>0</y>
- <width>171</width>
+ <width>231</width>
<height>32</height>
</rect>
</property>
<rect>
<x>130</x>
<y>36</y>
- <width>151</width>
+ <width>201</width>
<height>20</height>
</rect>
</property>
<enum>Qt::Horizontal</enum>
</property>
</widget>
- <widget class="QPushButton" name="fCTUSLoadSignalPushButton">
+ <widget class="QPushButton" name="fCTUSLoadCorrespondancesPushButton">
<property name="geometry">
<rect>
<x>20</x>
<y>60</y>
- <width>131</width>
+ <width>171</width>
<height>23</height>
</rect>
</property>
+ <property name="toolTip">
+ <string><html><head/><body><p>Load a file indicating the correspondances between time indices between both sequences.</p><p>The format needs to be the following:</p><p>let nt1 the number of frames in sequence 1, resp. nt2 and seq. 2 </p><p>The file must contain nt1 + nt2 entries.</p><p>entry i (i&lt;=nt1) indicates for the i-th frame of sequence 1 the index to display for sequence 2.</p><p>resp. i&gt;nt1 indicate corresp from seq. 2 to seq. 1</p></body></html></string>
+ </property>
<property name="text">
- <string>Load Fused Seq. Signal</string>
+ <string>Load Correspondances</string>
</property>
</widget>
</widget>
// Standard includes
#include <iostream>
+#include <fstream>
#include <sstream>
#include <iomanip>
#define COLUMN_IMAGE_NAME 7
#ifdef CLITK_PRIVATE_FEATURES
-#define EXTENSIONS "Images ( *.bmp *.png *.jpeg *.jpg *.tif *.mhd *.mha *.hdr *.vox *.his *.xdr *.SCAN *.nii *.nrrd *.nhdr *.refscan *.nii.gz *.usf)"
+#define EXTENSIONS "Images ( *.bmp *.png *.jpeg *.jpg *.tif *.mhd *.mha *.hdr *.vox *.his *.xdr *.SCAN *.nii *.nrrd *.nhdr *.refscan *.nii.gz *.usf *.svl)"
#else
#define EXTENSIONS "Images ( *.bmp *.png *.jpeg *.jpg *.tif *.mhd *.mha *.hdr *.vox *.his *.xdr *.SCAN *.nii *.nrrd *.nhdr *.refscan *.nii.gz)"
#endif
connect(actionDocumentation,SIGNAL(triggered()),this,SLOT(ShowDocumentation()));
connect(actionRegister_vv,SIGNAL(triggered()),this,SLOT(PopupRegisterForm()));
- connect(overlayPanel, SIGNAL(FusionSequenceSignalButtonPressed()), this, SLOT(SelectFusionSequenceTemporalSignal()));
+ connect(overlayPanel, SIGNAL(FusionSequenceCorrespondancesButtonPressed()), this, SLOT(SelectFusionSequenceCorrespondances()));
///////////////////////////////////////////////
}
//TODO: also remove the image overlaid with the main sequence, as it is becoming invalid...
+ //this shall be done by calling this->CloseImage() with the correct index;...
}
linkPanel->removeImage(index);
//------------------------------------------------------------------------------
-void vvMainWindow::SelectFusionSequenceTemporalSignal() {
+void vvMainWindow::SelectFusionSequenceCorrespondances() {
//make sure the index is right?
//in the end, I should attach the temporal data to the right sequence!
}
//open a dialog box to find a file
- QString Extensions = EXTENSIONS;
- Extensions += ";;All Files (*)";
+ //QString Extensions = EXTENSIONS;
+ QString Extensions = ";;All Files (*)";
QString fileName = QFileDialog::getOpenFileName(this,tr("Load respiratory signal for fused sequence"),mInputPathName,Extensions);
if (fileName.isNull())
return;
//read it as a vector of values
- std::vector<double> signal;
- //...TODO, look for itk functions that can do that... vnl in the worst case.
- signal.push_back(1);signal.push_back(2);
-
- //TODO: instead: if the loaded signal is longer, just crop it...
- //this allows loading only the first few frames when testing.
- //->maybe raise a message that this behavior may be unsafe...
-
- //if compatible with the fused image sequence (number of images = number of entries), enable the temporalSync
- if ( signal.size() >= mSlicerManagers[index]->GetFusionSequenceNbFrames()) {
- //for convenience, associate this sequence to both the current slicer manager, and to the linked one
- mSlicerManagers[index]->SetFusionSequenceTemporalSignal(signal);
- mSlicerManagers[ mSlicerManagers[index]->GetFusionSequenceIndexOfLinkedManager() ]->SetFusionSequenceTemporalSignal(signal);
- overlayPanel->enableFusionSequenceTemporalSync();
- QMessageBox::information(this,tr("Adding signal"),"would add the signal from file: "+ fileName);
+ vnl_vector<double> tmpVect;
+
+ std::ifstream file;
+ file.open(fileName.toStdString().c_str());
+ tmpVect.read_ascii(file);
+ file.close();
+
+ //if compatible with the fused image sequence (number of entries = nb of entries in main sequence + nb of entries in joint sequence), enable the temporalSync
+ bool signalOK = true;
+ unsigned nbFrameMain = mSlicerManagers[index]->GetImage()->GetTransform().size();
+ unsigned nbFrameSecondary = mSlicerManagers[index]->GetFusionSequenceNbFrames();
+
+ std::vector<unsigned> temporalCorrespondances;
+ if ( tmpVect.size() == nbFrameMain + nbFrameSecondary ) {
+ for (unsigned i=0 ; i<tmpVect.size() ; i++) {
+ if (i<nbFrameMain) { //first part of the file: i -> index in secondary seq.
+ if ( tmpVect(i)<nbFrameSecondary ) temporalCorrespondances.push_back(tmpVect(i));
+ else { signalOK=false; break; } //pointing outside the secondary sequence...
+ }
+ else { //first part of the file -> index in secondary seq.
+ if ( tmpVect(i)<nbFrameMain ) temporalCorrespondances.push_back(tmpVect(i));
+ else { signalOK=false; break; } //pointing outside the secondary sequence...
+ }
+ }
}
- else {//else, send a message to signal the failure...
- QString error = "The provided signal doesn't have the same duration as the sequence\n";
+ else {signalOK=false;}
+ if (!signalOK) {//else, send a message to signal the failure...
+ QString error = "The provided temporal correspondances is invalid - check tooltip.\n";
error += "Ignoring file: " + fileName;
- QMessageBox::information(this,tr("Problem adding signal!"),error);
+ QMessageBox::information(this,tr("Problem adding temporal correspondances!"),error);
return;
}
+ else {
+ //for convenience, associate this sequence to both the current slicer manager, and to the linked one
+ mSlicerManagers[index]->SetFusionSequenceCorrespondances(temporalCorrespondances);
+ mSlicerManagers[ mSlicerManagers[index]->GetFusionSequenceIndexOfLinkedManager() ]->SetFusionSequenceCorrespondances(temporalCorrespondances);
+ overlayPanel->enableFusionSequenceTemporalSync();
+ }
}
//------------------------------------------------------------------------------
if (spatialSyncFlag) { //reslice the CT
if (temporalSyncFlag) { //do the temporal synchronisation
- //TODO: add the temporal synchronisation stuff
- //if the button is checked, get the phase of the requested US frame from the available signal
- //and select the corresponding one in the CT. (check the one just before, and the one just after, and select the closest)
-
- //TODO: do it also the other way around, when modifying the time index related to CT, select a close frame
- //this should not be done here directly, but the code should be inspired from the one here
- //->find a good US frame such that when calling this function with this US frame, it produces the expected result
-
-
- //TODO: select the right CT image to display
int mainSequenceFrameIndex=0;
//estimate the TSlice to set to the CT
-
+ unsigned nbFramesMain = mSlicerManagers[index]->GetImage()->GetTransform().size();
+ mainSequenceFrameIndex = mSlicerManagers[index]->GetFusionSequenceCorrespondances()[ nbFramesMain + fusionSequenceFrameIndex];
//and set it!
mSlicerManagers[index]->SetTSlice(mainSequenceFrameIndex, false);
+ //warning, there is a loopback, and modification of the TSlice in main sequence forces an update of the TSlice in secondary, etc...
}
if (mSlicerManagers[i]->GetFusionSequenceTemporalSyncFlag()) {
//WARNING: for some obscure reason, there are problems when accessing mSlicerManagers[mSlicerManagers[i]->GetFusionSequenceIndexOfLinkedManager()]->GetFusionSequenceFrameIndex();
- //int estimatedValue=mSlicerManagers[mSlicerManagers[i]->GetFusionSequenceIndexOfLinkedManager()]->GetFusionSequenceFrameIndex();
int estimatedValue=0;
- //TODO: if temporal sync is active
//estimate a corresponding time index for the secondary (US) sequence, and update it accordingly.
- //estimatedValue = ...
- overlayPanel->updateFusionSequenceSliderValueFromWindow(estimatedValue, true);
+ estimatedValue = mSlicerManagers[i]->GetFusionSequenceCorrespondances()[ value ];
+ //TODO: at the moment, there is a loop in TSlice modifications
+ //modifying sequence 1 causes seq 2 to update, which in turns update seq1...
+ //I disable control on seq1 at the moment.
+ //overlayPanel->updateFusionSequenceSliderValueFromWindow(estimatedValue, true);
}
}
}
void SelectFusionImage();
//select the file(s) from the disk containing the image sequence to fuse
void SelectFusionSequence();
- void SelectFusionSequenceTemporalSignal();
+ void SelectFusionSequenceCorrespondances();
void ResetTransformationToIdentity();
connect(fCTUSSlider,SIGNAL(valueChanged(int)),this,SLOT(setFusionSequenceProperty()));
connect(fCTUSActivateSpaceSyncCheckBox,SIGNAL(stateChanged(int)),this,SLOT(setFusionSequenceProperty()));
connect(fCTUSActivateTimeSyncCheckBox,SIGNAL(stateChanged(int)),this,SLOT(setFusionSequenceProperty()));
- connect(fCTUSLoadSignalPushButton,SIGNAL(clicked()),this,SIGNAL(FusionSequenceSignalButtonPressed()));
+ connect(fCTUSLoadCorrespondancesPushButton,SIGNAL(clicked()),this,SIGNAL(FusionSequenceCorrespondancesButtonPressed()));
}
void vvOverlayPanel::getCurrentImageName(QString name)
void OverlayPropertyUpdated(int color, int linked, double window, double level);
void FusionPropertyUpdated(int opacity, int thresOpacity, int colormap, double window, double level, bool showLegend);
void FusionSequencePropertyUpdated(int sequenceFrameIndex, bool spatialSync, unsigned int sequenceLength, bool temporalSync);
- void FusionSequenceSignalButtonPressed();
+ void FusionSequenceCorrespondancesButtonPressed();
private:
bool disableFusionSignals;
mConcatenatedTransform = vtkSmartPointer<vtkTransform>::New();
mConcatenatedFusionTransform = vtkSmartPointer<vtkTransform>::New();
mConcatenatedOverlayTransform = vtkSmartPointer<vtkTransform>::New();
+ mFirstSetSliceOrientation = true;
}
//------------------------------------------------------------------------------
// DDV(cursorPos, 3);
// SetCurrentPosition(cursorPos[0],cursorPos[1],cursorPos[2],cursorPos[3]);
- if (this->Renderer && this->GetInput()) {
+ if (mFirstSetSliceOrientation) {
+ int *range = this->GetSliceRange();
+ if (range)
+ this->Slice = static_cast<int>((range[0] + range[1]) * 0.5);
+ mFirstSetSliceOrientation = false;
+ }
+ else if (this->Renderer && this->GetInput()) {
double s = mCursor[orientation];
double sCursor = (s - this->GetInput()->GetOrigin()[orientation])/this->GetInput()->GetSpacing()[orientation];
this->Slice = static_cast<int>(sCursor);
}
-
-// int *range = this->GetSliceRange();
-// if (range)
-// this->Slice = static_cast<int>((range[0] + range[1]) * 0.5);
this->UpdateOrientation();
this->UpdateDisplayExtent();
bool mOverlayVisibility;
bool mFusionVisibility;
bool mVFVisibility;
+ bool mFirstSetSliceOrientation;
};
#endif
mFusionSequenceListInitialTransformMatrices.push_back( tmpMat );
}
void SetFusionSequenceIndexOfLinkedManager(int index) { mFusionSequenceIndexLinkedManager = index; }
- void SetFusionSequenceTemporalSignal(std::vector<double> s) { mFusionSequenceTemporalSignal = s; }
+ void SetFusionSequenceCorrespondances(std::vector<unsigned> s) { mFusionSequenceCorrespondances = s; }
void SetFusionSequenceInvolvmentCode(int code) { mFusionSequenceInvolvementCode=code; }
int GetFusionSequenceInvolvmentCode() { return mFusionSequenceInvolvementCode;}
const vtkSmartPointer<vtkMatrix4x4>& GetFusionSequenceInitialTransformMatrixAtFrame(unsigned i) {
return mFusionSequenceListInitialTransformMatrices[i];
}
- const std::vector<double>& GetFusionSequenceTemporalSignal() {return mFusionSequenceTemporalSignal;}
+ const std::vector<unsigned>& GetFusionSequenceCorrespondances() {return mFusionSequenceCorrespondances;}
double GetColorWindow() const;
double GetColorLevel() const;
bool mFusionSequenceSpatialSyncFlag, mFusionSequenceTemporalSyncFlag; //flags indicating whether the spatial/temporal synchronization are actives
vtkSmartPointer<vtkMatrix4x4> mFusionSequenceMainTransform;
std::vector< vtkSmartPointer<vtkMatrix4x4> > mFusionSequenceListInitialTransformMatrices;
- std::vector<double> mFusionSequenceTemporalSignal;
+ std::vector<unsigned> mFusionSequenceCorrespondances;
int mPreset;
SlicingPresetType mSlicingPreset;