# uncomment next lines to have a file selector
# ---------------------------------------------
+/*
new FileSelector openFileDialog
set openFileDialog.Wildcard "(*.mhd)|*.mhd"
new MetaImageReader reader
connect openFileDialog.Out reader.In
+*/
# uncomment next lines to use Gimmick
# -----------------------------------
-/*
+
load creaImageIO
new Gimmick reader
-*/
+
new ViewerNV viewer
connect reader.Out viewer.In
{
vtkImageData* img = bbGetInputIn();
+/*
+ double spc[3];
+ img->GetSpacing(spc);
+ printf ("EED ViewerNV::Process A %f %f %f \n", spc[0], spc[1], spc[2] );
+ img->SetSpacing( 1,1,1 );
+ img->Update( );
+ img->GetSpacing(spc);
+ img->PrintSelf(std::cout,(vtkIndent)2);
+ img->Print(std::cout);
+ printf ("EED ViewerNV::Process B %f %f %f \n", spc[0], spc[1], spc[2] );
+*/
std::vector<int> type = bbGetInputnTypeView();
// std::cout<<"img "<<img<<std::endl;
SET(CPACK_NSIS_HELP_LINK "http://www.creatis.insa-lyon.fr/creatools/${PROJECT_NAME}")
SET(CPACK_NSIS_URL_INFO_ABOUT "http://www.creatis.insa-lyon.fr/creatools/${PROJECT_NAME}")
SET(CPACK_NSIS_CONTACT "info-dev@creatis.insa-lyon.fr")
- #SET(CPACK_NSIS_MODIFY_PATH ON)
+ SET(CPACK_NSIS_MODIFY_PATH ON)
ELSE(WIN32 AND NOT UNIX)
# SET(CPACK_STRIP_FILES "bin/bbi")
SET(CPACK_SOURCE_STRIP_FILES "")
void ContourExtractData::SetImage( vtkImageData* imagedata)
{
this->imagedata = imagedata;
+ this->imagedata->GetScalarRange(scalarRange);
// RaC 20-11-09 Changes in InitLstContoursLinesYPoints
int ext[6];
if ((i>=0) && (i<=ext[1]) && (j>=0) && (j<=ext[3]))
{
- if (isInside(i,j,_typeOperation)==true)
+ if (isInside(i,j,_typeOperation)==true)
{
- value = GetDataValue(i,j,zImage);
+ value = GetDataValue(i,j,zImage);
+ if ( (value>=scalarRange[0]) && (value<=scalarRange[1]) )
+ {
PutVtkImageDataResultValue(i,j,zImage, value );
- } // if
-
- }//if
+ } // scalarRange
+ } // if isInside
+ } // if ext
} // for i
} // for j
}
//------------------------------------------------------------------------
-void ContourExtractData::GetValuesInsideCrown(std::vector<double> *pLstValue,
- std::vector<double> *pLstValuePosX,
- std::vector<double> *pLstValuePosY,
- std::vector<double> *pLstValuePosZ)
+void ContourExtractData::GetValuesInsideCrown( int *numberOfPixels,
+ std::vector<double> *pLstValue,
+ std::vector<double> *pLstValuePosX,
+ std::vector<double> *pLstValuePosY,
+ std::vector<double> *pLstValuePosZ)
{
pLstValue->clear();
pLstValuePosX->clear();
int maxPoint[2];
int i,j;
double value;
-
+ int acum=0;
minPoint[0] = 999999;
minPoint[1] = 999999;
if ((i>=0) && (i<=ext[1]) && (j>=0) && (j<=ext[3]))
{
-
- if (isInside(i,j,_typeOperation)==true)
+ if (isInside(i,j,_typeOperation)==true)
{
- value = GetDataValue(i,j,zImage);
-
- // Borrame
- // if (okImagesResults==true){
- // PutVtkImageDataResultValue(i,j,zImage, value );
- // }
-
- pLstValue -> push_back( value );
- pLstValuePosX -> push_back( i );
- pLstValuePosY -> push_back( j );
- pLstValuePosZ -> push_back( -1 );
- } // if
-
- } //if
+ acum++;
+ value = GetDataValue(i,j,zImage);
+ if ( (value>=scalarRange[0]) && (value<=scalarRange[1]) )
+ {
+ pLstValue -> push_back( value );
+ pLstValuePosX -> push_back( i );
+ pLstValuePosY -> push_back( j );
+ pLstValuePosZ -> push_back( -1 );
+ } // scalarRange
+ } // if isInside
+ } // if ext
} // for
} // for
- // Borrame
- // if (this->okImagesResults==true){
- // imagedataValueResult->Modified();
- // imagedataMaskResult->Modified();
- // }
-
-
+ *numberOfPixels = acum;
}
//------------------------------------------------------------------------
acum_standardeviation = acum_standardeviation + tmp*tmp;
} // for standar deviation
standardeviation = sqrt(acum_standardeviation/size);
- SetVolumeStatistics(countRange, size,
- min,max,
- acum_average,acum_standardeviation);
+ SetVolumeStatistics(countRange, (*rsize),
+ min,max,
+ acum_average,acum_standardeviation);
} // if size
} // if NULL
}
+void ContourExtractData::SetScalarRange(double min, double max)
+{
+ scalarRange[0]=min;
+ scalarRange[1]=max;
+}
+
void ContourExtractData::SetSizeImageY(int pSizeImageY)
{
_sizeImageY=pSizeImageY;
void SetZtoBeAnalys( int z );
void SetLstManualContourModel( std::vector<manualBaseModel*> lstManConMod);
- void GetValuesInsideCrown( std::vector<double> *pLstValue,
+ void GetValuesInsideCrown( int *numberOfPixels,
+ std::vector<double> *pLstValue,
std::vector<double> *pLstValuePosX,
std::vector<double> *pLstValuePosY,
std::vector<double> *pLstValuePosZ);
double *vol_average, double *vol_standardeviation);
void ResetImageResult(int z);
+ void SetScalarRange(double min, double max);
void InitLstContoursLinesYPoints();
bool isInside(int x, int y, int typeOperation );
void SetSizeImageY(int pSizeImageY);
private:
+ double scalarRange[2];
bool okImagesResults;
//
{
ax = (*InX)[i]-SumX;
ay = (*InY)[i]-SumY;
- bx = (*InX)[i+1]-SumX;
- by = (*InY)[i+1]-SumY;
+ bx = (*InX)[(i+1)%size]-SumX;
+ by = (*InY)[(i+1)%size]-SumY;
axb = (ax*by) - (bx*ay);
if(axb > 0)
{
okFind=true;
i=sizeKeyContour;
}
- if ( (_KeyContourZ[i-1] != _KeyContourZ[i]) )
+ if ( (i<sizeKeyContour) && (_KeyContourZ[i-1] != _KeyContourZ[i]) )
{
tmpIdKeyContSizes++;
}
bool vtkInteractorScrollZ::OnRightButtonDown()
{
vtkRenderWindowInteractor *interactor = _vtkInteractorStyleBaseView->GetInteractor();
-printf("EED %p vtkInteractorScrollZ::OnRightButtonDown A", this );
if ((interactor->GetControlKey()==0) && (interactor->GetShiftKey()==0) ){
-printf("EED %p vtkInteractorScrollZ::OnRightButtonDown B", this );
_stateFordware = true;
_fordwareX = interactor->GetEventPosition()[0];
_fordwareY = interactor->GetEventPosition()[1];
bool vtkInteractorScrollZ::OnMouseMove ()
{
if (_stateFordware==true){
-printf("EED %p vtkInteractorScrollZ::OnMouseMove \n", this);
//int fx = _vtkInteractorStyleBaseView->GetInteractor()->GetEventPosition()[0]; // JPRx
int fy = _vtkInteractorStyleBaseView->GetInteractor()->GetEventPosition()[1];
int delta = (_fordwareY - fy)/3;
for (i=0;i<size;i++)
{
-printf("EED %p vtkInteractorStyleBaseView A i=%d size=%d sizeLst%d\n", this, i, size, _lstInteractorStyleMaracas.size() );
if (i < _lstInteractorStyleMaracas.size() )
{
intStyMar = _lstInteractorStyleMaracas[i];
} else {
intStyMar=NULL;
}
-printf("EED %p vtkInteractorStyleBaseView B i=%d size=%d sizeLst%d\n", this, i, size, _lstInteractorStyleMaracas.size() );
if (intStyMar!=NULL && intStyMar->GetActive()==true){
-printf("EED %p vtkInteractorStyleBaseView C i=%d size=%d sizeLst%d\n", this, i, size, _lstInteractorStyleMaracas.size() );
if (type ==1)
{ // OnRightButtonDown
if (intStyMar->OnRightButtonDown()==false)
//-------------------------------------------------------------------
wxVtkMPR3DView::~wxVtkMPR3DView()
{
- printf("EED wxVtkMPR3DView::~wxVtkMPR3DView\n");
VisiblePointWidget( false );
VisiblePlaneWidget( false );