Commit 0f7a041a authored by Franck Cecillon's avatar Franck Cecillon

Merge branch 'V3.2_191' of

https://code.ill.fr/instrument-control/nomad-modules.git into V3.2_191
parents 572d9b8d 86a9822e
To compile and install the modules:
./build.sh
cd build
make mod
To compile and install the modules:
./build.sh
cd build
make mod
......@@ -31,6 +31,7 @@
#include <Controller.h>
#include "../detector/DetectorElement.h"
#include "../ExperimentData.h"
namespace acquisition {
......@@ -93,6 +94,7 @@ public:
Property<bool> mergePlots; //! Number of plots property name
DynamicProperty<std::string> plotName; //! Plot name
DynamicProperty<std::string> plotTitle; //! Plot title
DynamicProperty<int32> detectorXPosition; //! Selected X
DynamicProperty<int32> detectorYPosition; //! Selected Y
DynamicProperty<int32> detectorZPosition; //! Selected Channel or Z
......@@ -124,6 +126,8 @@ public:
Property<float64> selectedRoiY0; //! Selected ROI for ROI operation
Property<float64> selectedRoiX1; //! Selected ROI for ROI operation
Property<float64> selectedRoiY1; //! Selected ROI for ROI operation
Property<bool> countActivated;
DynamicProperty<bool> useMultiplot; //! Use external multiplot
DynamicProperty<std::string> multiplotType; //! Multiplot type
DynamicArrayProperty2<float64> multiplotXData; //! Multiplot X plot data
......@@ -131,6 +135,14 @@ public:
DynamicArrayProperty2<int32> multiplotZData; //! Multiplot Z plot data
DynamicArrayProperty<int32> multiplotReady; //! Multiplot ready
DynamicProperty<bool> useWebspy; //! Use Webspy plot
// Save plots state for offscreen plots
DynamicProperty<bool> useGrid;
DynamicProperty<bool> useLog;
DynamicProperty<std::string> colorMap;
DynamicProperty<float64> minColorLimit;
DynamicProperty<float64> maxColorLimit;
// Cut property
Property<int32> cutPlotIndex;
Property<float64> cutPX0;
......@@ -145,6 +157,7 @@ public:
DynamicProperty<bool> autoContrast;
DynamicProperty<int32> minContrast;
DynamicProperty<int32> maxContrast;
DynamicProperty<bool> imageGeneration;
private:
......@@ -201,6 +214,13 @@ private:
*/
void calculate(int32 nbElement);
/*!
* \brief compute all plots and multiplots for a detector element
*
* \param[in] nbElement The element number
*/
void calculateMultiplot(int32 nbElement);
/*!
* \brief cut the plot
*/
......@@ -232,13 +252,20 @@ private:
void updateDetectorData(int32 index, ControllerPtr<DetectorElement>& detector);
void updateDetectorNbRoi(int32 index, ControllerPtr<DetectorElement>& detector);
void updateDetectorRois(int32 plot, ControllerPtr<DetectorElement>& detector, int32 roi);
void updateDetectorRoiSum(int32 plot, ControllerPtr<DetectorElement>& detector, int32 roi);
void updateCountActivated(ControllerPtr<DetectorElement>& detector);
void updateOffscreenImageProperty(int32 index);
void updateSelectedRoi(int32 index, ControllerPtr<DetectorElement>& detector);
void updateNumor();
float64* m_CutDatax;
float64* m_CutDatay;
ExperimentData* m_Title;
/*
* Constantes
*/
......
......@@ -73,6 +73,13 @@ void RawState::setData(DataContainer& data) throw (CannotPlot) {
m_Nw = data.nw;
m_XData = setGeometry(0, NULL, newxsize);
m_YData = setGeometry(1, NULL, newysize);
if (resize == true) {
m_DontDeleteZData = false;
m_ZData = new int32[newxsize * newysize];
}
else {
m_DontDeleteZData = true;
}
}
m_XSize = newxsize;
m_YSize = newysize;
......@@ -83,8 +90,6 @@ void RawState::setData(DataContainer& data) throw (CannotPlot) {
adjust(data.nx * data.ny, data.dataMin, data.dataMax, data.data);
}
if (resize == true) {
m_DontDeleteZData = false;
m_ZData = new int32[m_ZSize];
// Counter c1;
CImg<int32> img(data.data, data.ny, data.nx);
CImg<int32> res = img.resize(m_YSize, m_XSize);
......@@ -100,7 +105,6 @@ void RawState::setData(DataContainer& data) throw (CannotPlot) {
// cout << "time : " << c1.getTime() << endl;
} else {
m_ZData = data.data;
m_DontDeleteZData = true;
}
m_XLegend = X_LEGEND;
m_YLegend = Y_LEGEND;
......@@ -115,9 +119,9 @@ void RawState::setData(DataContainer& data) throw (CannotPlot) {
m_Nw = data.nw;
m_Nx = data.nx;
m_XData = setGeometry(0, data.xGeometry, m_Nx);
m_DontDeleteZData = true;
}
m_ZData = data.data;
m_DontDeleteZData = true;
m_XSize = m_Nx;
m_YSize = 0;
m_ZSize = m_Nx;
......@@ -134,9 +138,9 @@ void RawState::setData(DataContainer& data) throw (CannotPlot) {
m_Nw = data.nw;
m_Ny = data.ny;
m_XData = setGeometry(0, data.xGeometry, m_Ny);
m_DontDeleteZData = true;
}
m_ZData = data.data;
m_DontDeleteZData = true;
m_XSize = m_Ny;
m_YSize = 0;
m_ZSize = m_Ny;
......@@ -151,11 +155,11 @@ void RawState::setData(DataContainer& data) throw (CannotPlot) {
m_Nx = data.nx;
m_Ny = data.ny;
m_XData = setGeometry(0, data.xGeometry, m_Nx);
m_DontDeleteZData = true;
}
m_Nz = data.nz;
m_Nw = data.nw;
m_ZData = data.data;
m_DontDeleteZData = true;
m_XSize = m_Nx;
m_YSize = 0;
m_ZSize = m_Ny;
......@@ -180,6 +184,7 @@ void RawState::setData(DataContainer& data) throw (CannotPlot) {
m_XData = setGeometry(0, NULL, m_Nx);
m_YData = setGeometry(1, NULL, m_Ny);
m_ZData = new int32[m_Nx * m_Ny];
m_DontDeleteZData = false;
}
memset(m_ZData, 0, sizeof(int32) * m_Nx * m_Ny);
if (data.dataType == AcquisitionController::CHANNEL_DATA_TYPE) {
......@@ -201,7 +206,6 @@ void RawState::setData(DataContainer& data) throw (CannotPlot) {
}
}
}
m_DontDeleteZData = false;
m_XSize = m_Nx;
m_YSize = m_Ny;
m_ZSize = m_Nx * m_Ny;
......@@ -221,6 +225,7 @@ void RawState::setData(DataContainer& data) throw (CannotPlot) {
m_XData = setGeometry(0, NULL, m_Nx);
m_YData = setGeometry(1, NULL, m_Nz);
m_ZData = new int32[m_Nz * m_Nx];
m_DontDeleteZData = false;
}
if (data.dataType == AcquisitionController::CHANNEL_DATA_TYPE) {
for (int32 i = 0; i < m_Nx; ++i) {
......@@ -241,7 +246,6 @@ void RawState::setData(DataContainer& data) throw (CannotPlot) {
}
}
}
m_DontDeleteZData = false;
m_XSize = m_Nx;
m_YSize = m_Nz;
m_ZSize = m_Nx * m_Nz;
......@@ -261,6 +265,7 @@ void RawState::setData(DataContainer& data) throw (CannotPlot) {
// No geometry yet
m_YData = setGeometry(1, NULL, m_Ny);
m_ZData = new int32[m_Ny * m_Nz];
m_DontDeleteZData = false;
}
if (data.dataType == AcquisitionController::CHANNEL_DATA_TYPE) {
for (int32 i = 0; i < m_Nz; ++i) {
......@@ -281,7 +286,6 @@ void RawState::setData(DataContainer& data) throw (CannotPlot) {
}
}
}
m_DontDeleteZData = false;
m_XSize = m_Nz;
m_YSize = m_Ny;
m_ZSize = m_Nz * m_Ny;
......@@ -298,9 +302,9 @@ void RawState::setData(DataContainer& data) throw (CannotPlot) {
m_Nz = data.nz;
m_Nw = data.nw;
m_XData = setGeometry(0, data.xGeometry, m_Nz);
m_DontDeleteZData = true;
}
m_ZData = data.data;
m_DontDeleteZData = true;
m_XSize = m_Nz;
m_YSize = 0;
m_ZSize = m_Nz;
......@@ -326,6 +330,7 @@ void RawState::setData(DataContainer& data) throw (CannotPlot) {
m_XData = setGeometry(0, NULL, m_Nx);
m_YData = setGeometry(1, NULL, m_Ny);
m_ZData = new int32[m_Nx * m_Ny];
m_DontDeleteZData = false;
}
memset(m_ZData, 0, sizeof(int32) * m_Nx * m_Ny);
if ((data.dataType == AcquisitionController::CHANNEL_DATA_TYPE)
......@@ -342,7 +347,6 @@ void RawState::setData(DataContainer& data) throw (CannotPlot) {
}
}
}
m_DontDeleteZData = false;
m_XSize = m_Nx;
m_YSize = m_Ny;
m_ZSize = m_Nx * m_Ny;
......@@ -362,6 +366,7 @@ void RawState::setData(DataContainer& data) throw (CannotPlot) {
m_XData = setGeometry(0, NULL, m_Nx);
m_YData = setGeometry(1, NULL, m_Nw);
m_ZData = new int32[m_Nx * m_Nw];
m_DontDeleteZData = false;
}
memset(m_ZData, 0, sizeof(int32) * m_Nx * m_Nw);
if ((data.dataType == AcquisitionController::CHANNEL_DATA_TYPE)
......@@ -378,7 +383,6 @@ void RawState::setData(DataContainer& data) throw (CannotPlot) {
}
}
}
m_DontDeleteZData = false;
m_XSize = m_Nx;
m_YSize = m_Nw;
m_ZSize = m_Nx * m_Nw;
......@@ -397,12 +401,18 @@ void RawState::setData(DataContainer& data) throw (CannotPlot) {
m_XData = setGeometry(0, NULL, m_Nw);
// No geometry yet
m_YData = setGeometry(1, NULL, m_Ny);
m_ZData = new int32[m_Ny * m_Nw];
if ((data.dataType == AcquisitionController::CHANNEL_DATA_TYPE)
|| (data.dataType == AcquisitionController::CELL_DATA_TYPE)) {
m_DontDeleteZData = true;
}
else {
m_ZData = new int32[m_Ny * m_Nw];
m_DontDeleteZData = false;
}
}
if ((data.dataType == AcquisitionController::CHANNEL_DATA_TYPE)
|| (data.dataType == AcquisitionController::CELL_DATA_TYPE)) {
m_ZData = data.data;
m_DontDeleteZData = true;
} else if (data.dataType == AcquisitionController::MASTERACQ_DATA_TYPE) {
memset(m_ZData, 0, sizeof(int32) * m_Ny * m_Nw);
for (int32 i = 0; i < m_Nw; ++i) {
......@@ -410,7 +420,6 @@ void RawState::setData(DataContainer& data) throw (CannotPlot) {
m_ZData[j + i * m_Ny] += data.data[i + j * m_Nw];
}
}
m_DontDeleteZData = false;
}
m_XSize = m_Nw;
m_YSize = m_Ny;
......@@ -429,9 +438,9 @@ void RawState::setData(DataContainer& data) throw (CannotPlot) {
m_Nz = data.nz;
m_Nw = data.nw;
m_XData = setGeometry(0, NULL, m_Nw);
m_DontDeleteZData = true;
}
m_ZData = data.data;
m_DontDeleteZData = true;
m_XSize = m_Nw;
m_YSize = 0;
m_ZSize = m_Nw;
......@@ -461,6 +470,7 @@ void RawState::setData(DataContainer& data) throw (CannotPlot) {
m_XData = setGeometry(0, NULL, m_Nx);
m_YData = setGeometry(1, NULL, m_Ny);
m_ZData = new int32[m_Nx * m_Ny];
m_DontDeleteZData = false;
}
memset(m_ZData, 0, sizeof(int32) * m_Nx * m_Ny);
if (data.dataType == AcquisitionController::CHANNEL_DATA_TYPE) {
......@@ -488,7 +498,6 @@ void RawState::setData(DataContainer& data) throw (CannotPlot) {
}
}
}
m_DontDeleteZData = false;
m_XSize = m_Nx;
m_YSize = m_Ny;
m_ZSize = m_Nx * m_Ny;
......@@ -508,6 +517,7 @@ void RawState::setData(DataContainer& data) throw (CannotPlot) {
// No geometry yet
m_YData = setGeometry(1, NULL, m_Nz);
m_ZData = new int32[m_Nz * m_Nx];
m_DontDeleteZData = false;
}
memset(m_ZData, 0, sizeof(int32) * m_Nx * m_Nz);
if (data.dataType == AcquisitionController::CHANNEL_DATA_TYPE) {
......@@ -533,12 +543,12 @@ void RawState::setData(DataContainer& data) throw (CannotPlot) {
}
}
}
m_DontDeleteZData = false;
m_XSize = m_Nx;
m_YSize = m_Nz;
m_ZSize = m_Nx * m_Nz;
m_XLegend = X_LEGEND;
m_YLegend = CHANNELS_LEGEND;
m_DontDeleteZData = false;
} else if ((data.nx == 1) && (data.ny > 1)) {
// 1D
// create new arrays if necessary
......@@ -583,7 +593,6 @@ void RawState::setData(DataContainer& data) throw (CannotPlot) {
}
}
}
m_DontDeleteZData = false;
m_XSize = m_Nz;
m_YSize = m_Ny;
m_ZSize = m_Nz * m_Ny;
......@@ -604,9 +613,9 @@ void RawState::setData(DataContainer& data) throw (CannotPlot) {
m_Nw = data.nw;
m_XData = setGeometry(0, NULL, m_Nw);
m_YData = setGeometry(1, NULL, m_Nz);
m_DontDeleteZData = true;
}
m_ZData = data.data;
m_DontDeleteZData = true;
m_XSize = m_Nw;
m_YSize = m_Nz;
m_ZSize = m_Nw * m_Nz;
......@@ -803,10 +812,10 @@ void RawState::updateRoi(DataPlot* dataPlot, int32 plot, int32 roi, float64 x0,
outx1 = x1;
outy1 = 0;
} else if ((m_Nx == 1) && (m_Ny > 1)) {
outx0 = 0;
outy0 = x0;
outx1 = 0;
outy1 = x1;
outx0 = y0;
outy0 = 0;
outx1 = y1;
outy1 = 0;
}
} else if ((m_Nz > 1) && (m_Nw == 1)) {
/*
......
......@@ -18,6 +18,9 @@
#include "SumState.h"
#include "CImg.h"
using namespace cimg_library;
#include <cstring>
namespace acquisition {
......@@ -40,6 +43,12 @@ void SumState::setSumState(DataPlot* dataPlot) {
void SumState::setData(DataContainer& data) throw (CannotPlot) {
if ((data.nz > 1) && (data.nw == 1)) {
bool resize = false;
int32 newzsize = data.nz;
if (data.nz > XMAX) {
resize = true;
newzsize = XMAX;
}
/*
* Using z
*/
......@@ -49,36 +58,50 @@ void SumState::setData(DataContainer& data) throw (CannotPlot) {
deleteZData();
m_Nx = data.nx;
m_Ny = data.ny;
m_Nz = data.nz;
m_Nz = newzsize;
m_Nw = data.nw;
// No geometry yet
m_XData = setGeometry(0, NULL, m_Nz);
m_ZData = new int32[m_Nz];
m_DontDeleteZData = false;
m_ZData = new int32[newzsize];
}
memset(m_ZData, 0, sizeof(int32) * m_Nz);
m_XSize = newzsize;
m_YSize = 0;
m_ZSize = newzsize;
int32* tmparray = new int32[data.nz];
memset(tmparray, 0, sizeof(int32) * data.nz);
if (data.dataType == AcquisitionController::CHANNEL_DATA_TYPE) {
for (int32 i = 0; i < m_Nx * m_Ny; ++i) {
for (int32 j = 0; j < m_Nz; ++j) {
m_ZData[j] += data.data[j + i * m_Nz];
for (int32 j = 0; j < data.nz; ++j) {
tmparray[j] += data.data[j + i * data.nz];
}
}
} else if (data.dataType == AcquisitionController::CELL_DATA_TYPE) {
for (int32 i = 0; i < m_Nx * m_Ny; ++i) {
for (int32 j = 0; j < m_Nz; ++j) {
m_ZData[j] += data.data[i + j * m_Nx * m_Ny];
for (int32 j = 0; j < data.nz; ++j) {
tmparray[j] += data.data[i + j * m_Nx * m_Ny];
}
}
} else if (data.dataType == AcquisitionController::MASTERACQ_DATA_TYPE) {
for (int32 i = 0; i < m_Nx * m_Ny; ++i) {
for (int32 j = 0; j < m_Nz; ++j) {
m_ZData[j] += data.data[j + i * m_Nz];
for (int32 j = 0; j < data.nz; ++j) {
tmparray[j] += data.data[j + i * data.nz];
}
}
}
m_DontDeleteZData = false;
m_XSize = m_Nz;
m_YSize = 0;
m_ZSize = m_Nz;
if (resize == true) {
CImg<int32> img(tmparray, data.nz);
CImg<int32> res = img.resize(m_ZSize);
memcpy(m_ZData, res.data(), m_ZSize * sizeof(int32));
float64 factor = (float64) data.nz / (float64) m_ZSize;
for (int32 i = 0; i < m_XSize; ++i) {
m_XData[i] = (float64) i * factor;
}
} else {
// No geometry yet
memcpy(m_ZData, tmparray, m_ZSize * sizeof(int32));
}
m_XLegend = CHANNELS_LEGEND;
m_YLegend = SUMS_LEGEND;
} else if ((data.nz == 1) && (data.nw > 1)) {
......@@ -96,6 +119,7 @@ void SumState::setData(DataContainer& data) throw (CannotPlot) {
// No geometry yet
m_XData = setGeometry(0, NULL, m_Nw);
m_ZData = new int32[m_Nw];
m_DontDeleteZData = false;
}
memset(m_ZData, 0, sizeof(int32) * m_Nw);
if (data.dataType == AcquisitionController::CHANNEL_DATA_TYPE) {
......@@ -117,7 +141,6 @@ void SumState::setData(DataContainer& data) throw (CannotPlot) {
}
}
}
m_DontDeleteZData = false;
m_XSize = m_Nw;
m_YSize = 0;
m_ZSize = m_Nw;
......@@ -144,6 +167,7 @@ void SumState::setData(DataContainer& data) throw (CannotPlot) {
// No geometry yet
m_XData = setGeometry(0, NULL, m_Nw);
m_ZData = new int32[m_Nw];
m_DontDeleteZData = false;
}
memset(m_ZData, 0, sizeof(int32) * m_Nw);
if (data.dataType == AcquisitionController::CHANNEL_DATA_TYPE) {
......@@ -171,7 +195,6 @@ void SumState::setData(DataContainer& data) throw (CannotPlot) {
}
}
}
m_DontDeleteZData = false;
m_XSize = m_Nw;
m_YSize = 0;
m_ZSize = m_Nw;
......
......@@ -59,20 +59,24 @@ void WSliceState::setData(DataContainer& data) throw (CannotPlot) {
m_Nw = data.nw;
m_XData = setGeometry(0, NULL, m_Nx);
m_YData = setGeometry(1, NULL, m_Ny);
if (data.dataType == AcquisitionController::CHANNEL_DATA_TYPE) {
m_DontDeleteZData = true;
} else if (data.dataType == AcquisitionController::CELL_DATA_TYPE) {
m_DontDeleteZData = true;
} else if (data.dataType == AcquisitionController::MASTERACQ_DATA_TYPE) {
m_ZData = new int32[m_Nx * m_Ny];
m_DontDeleteZData = false;
}
}
if (data.dataType == AcquisitionController::CHANNEL_DATA_TYPE) {
m_ZData = &data.data[m_Position * m_Nx * m_Ny];
m_DontDeleteZData = true;
} else if (data.dataType == AcquisitionController::CELL_DATA_TYPE) {
m_ZData = &data.data[m_Position * m_Nx * m_Ny];
m_DontDeleteZData = true;
} else if (data.dataType == AcquisitionController::MASTERACQ_DATA_TYPE) {
m_ZData = new int32[m_Nx * m_Ny];
memset(m_ZData, 0, sizeof(int32) * m_Nx * m_Ny);
for (int32 j = 0; j < m_Nx * m_Ny; ++j) {
m_ZData[j] = data.data[j * m_Nw + m_Position];
}
m_DontDeleteZData = false;
}
m_XSize = m_Nx;
m_YSize = m_Ny;
......@@ -91,20 +95,24 @@ void WSliceState::setData(DataContainer& data) throw (CannotPlot) {
m_Nz = data.nz;
m_Nw = data.nw;
m_XData = setGeometry(0, data.xGeometry, m_Nx);
if (data.dataType == AcquisitionController::CHANNEL_DATA_TYPE) {
m_DontDeleteZData = true;
} else if (data.dataType == AcquisitionController::CELL_DATA_TYPE) {
m_DontDeleteZData = true;
} else if (data.dataType == AcquisitionController::MASTERACQ_DATA_TYPE) {
m_ZData = new int32[m_Nx];
m_DontDeleteZData = false;
}
}
if (data.dataType == AcquisitionController::CHANNEL_DATA_TYPE) {
m_ZData = &data.data[m_Position * m_Nx];
m_DontDeleteZData = true;
} else if (data.dataType == AcquisitionController::CELL_DATA_TYPE) {
m_ZData = &data.data[m_Position * m_Nx];
m_DontDeleteZData = true;
} else if (data.dataType == AcquisitionController::MASTERACQ_DATA_TYPE) {
m_ZData = new int32[m_Nx];
memset(m_ZData, 0, sizeof(int32) * m_Nx);
for (int32 j = 0; j < m_Nx; ++j) {
m_ZData[j] = data.data[j * m_Nw + m_Position];
}
m_DontDeleteZData = false;
}
m_XSize = m_Nx;
m_YSize = 0;
......@@ -123,20 +131,24 @@ void WSliceState::setData(DataContainer& data) throw (CannotPlot) {
m_Nz = data.nz;
m_Nw = data.nw;
m_XData = setGeometry(0, data.yGeometry, m_Ny);
if (data.dataType == AcquisitionController::CHANNEL_DATA_TYPE) {
m_DontDeleteZData = true;
} else if (data.dataType == AcquisitionController::CELL_DATA_TYPE) {
m_DontDeleteZData = true;
} else if (data.dataType == AcquisitionController::MASTERACQ_DATA_TYPE) {
m_ZData = new int32[m_Ny];
m_DontDeleteZData = false;
}
}
if (data.dataType == AcquisitionController::CHANNEL_DATA_TYPE) {
m_ZData = &data.data[m_Position * m_Ny];
m_DontDeleteZData = true;
} else if (data.dataType == AcquisitionController::CELL_DATA_TYPE) {
m_ZData = &data.data[m_Position * m_Ny];
m_DontDeleteZData = true;
} else if (data.dataType == AcquisitionController::MASTERACQ_DATA_TYPE) {
m_ZData = new int32[m_Ny];
memset(m_ZData, 0, sizeof(int32) * m_Ny);
for (int32 j = 0; j < m_Ny; ++j) {
m_ZData[j] = data.data[j * m_Nw + m_Position];
}
m_DontDeleteZData = false;
}
m_XSize = m_Ny;
m_YSize = 0;
......@@ -161,6 +173,7 @@ void WSliceState::setData(DataContainer& data) throw (CannotPlot) {
m_XData = setGeometry(0, NULL, m_Nx);
m_YData = setGeometry(1, NULL, m_Ny);
m_ZData = new int32[m_Nx * m_Ny];
m_DontDeleteZData = false;
}
memset(m_ZData, 0, sizeof(int32) * m_Nx * m_Ny);
if (data.dataType == AcquisitionController::CHANNEL_DATA_TYPE) {
......@@ -182,7 +195,6 @@ void WSliceState::setData(DataContainer& data) throw (CannotPlot) {
}
}
}
m_DontDeleteZData = false;
m_XSize = m_Nx;
m_YSize = m_Ny;
m_ZSize = m_Nx * m_Ny;
......@@ -202,6 +214,7 @@ void WSliceState::setData(DataContainer& data) throw (CannotPlot) {
m_XData = setGeometry(0, data.xGeometry, m_Nx);
m_YData = setGeometry(0, data.yGeometry, m_Nz);
m_ZData = new int32[m_Nx * m_Nz];
m_DontDeleteZData = false;
}
memset(m_ZData, 0, sizeof(int32) * m_Nx * m_Nz);
if (data.dataType == AcquisitionController::CHANNEL_DATA_TYPE) {
......@@ -223,7 +236,6 @@ void WSliceState::setData(DataContainer& data) throw (CannotPlot) {
}
}
}
m_DontDeleteZData = false;
m_XSize = m_Nx;
m_YSize = m_Nz;
m_ZSize = m_Nx * m_Nz;
......@@ -243,6 +255,7 @@ void WSliceState::setData(DataContainer& data) throw (CannotPlot) {
m_XData = setGeometry(0, data.xGeometry, m_Nz);
m_YData = setGeometry(0, data.yGeometry, m_Ny);
m_ZData = new int32[m_Ny * m_Nz];
m_DontDeleteZData = false;
}
memset(m_ZData, 0, sizeof(int32) * m_Ny * m_Nz);
if (data.dataType == AcquisitionController::CHANNEL_DATA_TYPE) {
......@@ -264,7 +277,6 @@ void WSliceState::setData(DataContainer& data) throw (CannotPlot) {
}
}
}
m_DontDeleteZData = false;
m_XSize = m_Nz;
m_YSize = m_Ny;
m_ZSize = m_Ny * m_Nz;
......@@ -282,16 +294,14 @@ void WSliceState::setData(DataContainer& data) throw (CannotPlot) {
m_Nz = data.nz;
m_Nw = data.nw;
m_XData = setGeometry(0, data.xGeometry, m_Nz);
m_DontDeleteZData = true;
}
if (data.dataType == AcquisitionController::CHANNEL_DATA_TYPE) {
m_ZData = &data.data[m_Position * m_Nz];
m_DontDeleteZData = true;
} else if (data.dataType == AcquisitionController::CELL_DATA_TYPE) {
m_ZData = &data.data[m_Position * m_Nz];
m_DontDeleteZData = true;
} else if (data.dataType == AcquisitionController::MASTERACQ_DATA_TYPE) {
m_ZData = &data.data[m_Position * m_Nz];
m_DontDeleteZData = true;
}
m_XSize = m_Nz;
m_YSize = 0;
......
......@@ -18,6 +18,9 @@
#include "XSliceState.h"
#include "CImg.h"
using namespace cimg_library;