You can subscribe to this list here.
2009 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(144) |
Jul
(5) |
Aug
(23) |
Sep
(3) |
Oct
(8) |
Nov
(6) |
Dec
(3) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2010 |
Jan
(4) |
Feb
|
Mar
(34) |
Apr
(1) |
May
(10) |
Jun
(12) |
Jul
(17) |
Aug
(28) |
Sep
(2) |
Oct
|
Nov
(2) |
Dec
(3) |
2011 |
Jan
(4) |
Feb
(7) |
Mar
(5) |
Apr
(1) |
May
|
Jun
(15) |
Jul
(1) |
Aug
(7) |
Sep
(9) |
Oct
(3) |
Nov
|
Dec
(1) |
2012 |
Jan
(1) |
Feb
(13) |
Mar
(6) |
Apr
|
May
(1) |
Jun
|
Jul
(1) |
Aug
(9) |
Sep
(7) |
Oct
(2) |
Nov
|
Dec
|
2013 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <coe...@us...> - 2010-09-07 07:45:17
|
Revision: 329 http://mevislabmodules.svn.sourceforge.net/mevislabmodules/?rev=329&view=rev Author: coertmetz Date: 2010-09-07 07:45:10 +0000 (Tue, 07 Sep 2010) Log Message: ----------- CM: Added export of time point number. Modified Paths: -------------- trunk/Community/General/Sources/ML/MLCSOCommunityModules/CSOPointsToXMarkers/mlCSOPointsToXMarkers.cpp Modified: trunk/Community/General/Sources/ML/MLCSOCommunityModules/CSOPointsToXMarkers/mlCSOPointsToXMarkers.cpp =================================================================== --- trunk/Community/General/Sources/ML/MLCSOCommunityModules/CSOPointsToXMarkers/mlCSOPointsToXMarkers.cpp 2010-08-20 11:15:46 UTC (rev 328) +++ trunk/Community/General/Sources/ML/MLCSOCommunityModules/CSOPointsToXMarkers/mlCSOPointsToXMarkers.cpp 2010-09-07 07:45:10 UTC (rev 329) @@ -176,6 +176,8 @@ if (outputPathPoints) { std::list<vec3> points; + // Get time point + const int timepoint = cso->getTimePointIndex(); // First collect all pathpoints for (unsigned int i=0; i<cso->numPathPointLists(); ++i) { CSOPathPoints* pathList=cso->getPathPointsAt(i); @@ -192,6 +194,7 @@ // Create marker XMarker markerPath(*it); markerPath.type = j; + markerPath.pos[ 4 ] = timepoint; // Compute normal if (outputNormals && inPlane) { // Determine prev and next it @@ -231,12 +234,14 @@ // Add marker to output list _outputXMarkerList.appendItem(markerPath); } - } else{ + } else { for (unsigned int i=0; i<cso->numSeedPoints(); ++i) { CSOSeedPoint * seedpoint = cso->getSeedPointAt(i); + const int timepoint = cso->getTimePointIndex(); vec3 pos = seedpoint->worldPosition; XMarker marker (pos); marker.type = j; + marker.pos[ 4 ] = timepoint; if (inPlane && outputNormals) { // Determine previous and next marker This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wol...@us...> - 2010-08-20 11:15:52
|
Revision: 328 http://mevislabmodules.svn.sourceforge.net/mevislabmodules/?rev=328&view=rev Author: wolfspindler Date: 2010-08-20 11:15:46 +0000 (Fri, 20 Aug 2010) Log Message: ----------- ThirdParty package added to generated doxygen generation. Modified Paths: -------------- trunk/Community/General/Documentation/Sources/CommunitySourcesDoxygenConfig.txt Modified: trunk/Community/General/Documentation/Sources/CommunitySourcesDoxygenConfig.txt =================================================================== --- trunk/Community/General/Documentation/Sources/CommunitySourcesDoxygenConfig.txt 2010-08-20 09:06:59 UTC (rev 327) +++ trunk/Community/General/Documentation/Sources/CommunitySourcesDoxygenConfig.txt 2010-08-20 11:15:46 UTC (rev 328) @@ -1,5 +1,5 @@ PROJECT_NAME = "C++ Reference of MeVisLab Community Sources" -INPUT = $${MLAB_Community_General}/Sources $${MLAB_Community_General}/Modules $${MLAB_UMD_METK}/Sources $${MLAB_UMD_METK}/Modules $${MLAB_Community_General}/Documentation/Sources +INPUT = $${MLAB_Community_General}/Sources $${MLAB_Community_General}/Modules $${MLAB_UMD_METK}/Sources $${MLAB_UMD_METK}/Modules $${MLAB_Community_General}/Documentation/Sources $${MLAB_Community_ThirdParty}/Sources $${MLAB_Community_ThirdParty}/Modules FILE_PATTERNS = *.h *.hxx *.py *.js ENABLED_SECTIONS = USE_MCS_GLOBAL_DOXYGEN_DOC IGNORE_PREFIX = MLAB This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bar...@us...> - 2010-08-20 09:07:05
|
Revision: 327 http://mevislabmodules.svn.sourceforge.net/mevislabmodules/?rev=327&view=rev Author: bartdedobbelaer Date: 2010-08-20 09:06:59 +0000 (Fri, 20 Aug 2010) Log Message: ----------- - Improved string copying to matlab engine Modified Paths: -------------- trunk/Community/General/Sources/ML/MLMatlabScriptWrapper/mlMatlabScriptWrapper.cpp Modified: trunk/Community/General/Sources/ML/MLMatlabScriptWrapper/mlMatlabScriptWrapper.cpp =================================================================== --- trunk/Community/General/Sources/ML/MLMatlabScriptWrapper/mlMatlabScriptWrapper.cpp 2010-08-19 22:14:08 UTC (rev 326) +++ trunk/Community/General/Sources/ML/MLMatlabScriptWrapper/mlMatlabScriptWrapper.cpp 2010-08-20 09:06:59 UTC (rev 327) @@ -885,10 +885,18 @@ setPos<<"]"; setVec<<"]"; setType<<"]"; - // Put XMarkerList into matlab structure. - engEvalString(m_pEngine, setPos.str().c_str()); - engEvalString(m_pEngine, setVec.str().c_str()); - engEvalString(m_pEngine, setType.str().c_str()); + + std::ostringstream all; + all << setPos.str() << "\n" << setVec.str() << "\n" << setType.str() << "\n"; + + mxArray *m_X = mxCreateString(all.str().c_str()); + if (m_X) { + if (engPutVariable(m_pEngine, "copyInputXMarkerToMatlab", m_X) == 0) { + engEvalString(m_pEngine, "eval(copyInputXMarkerToMatlab); clear copyInputXMarkerToMatlab;"); + } + } + mxDestroyArray(m_X); m_X = NULL; + } //! Gets XMarkerList from Matlab and copies results into output XMarkerList. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <li...@us...> - 2010-08-19 22:14:14
|
Revision: 326 http://mevislabmodules.svn.sourceforge.net/mevislabmodules/?rev=326&view=rev Author: linaliu Date: 2010-08-19 22:14:08 +0000 (Thu, 19 Aug 2010) Log Message: ----------- remove unnecessary files Removed Paths: ------------- trunk/Community/General/Sources/ML/MLCSOToRTStructure/RTStructure.cpp trunk/Community/General/Sources/ML/MLCSOToRTStructure/RTStructure.h Deleted: trunk/Community/General/Sources/ML/MLCSOToRTStructure/RTStructure.cpp =================================================================== --- trunk/Community/General/Sources/ML/MLCSOToRTStructure/RTStructure.cpp 2010-08-19 22:11:55 UTC (rev 325) +++ trunk/Community/General/Sources/ML/MLCSOToRTStructure/RTStructure.cpp 2010-08-19 22:14:08 UTC (rev 326) @@ -1,23 +0,0 @@ -//---------------------------------------------------------------------------------- -//! The ML module class ImportRTStructure. -/*! -// \file mlImportRTStructure.cpp -// \author Lina Liu, Dimitre Hristov -// \date 2010-01-15 -// -// Import RT structure from a DCM file and convert it into a CSO group -*/ -//---------------------------------------------------------------------------------- - -// Local includes -#include "RTStructure.h" - -ML_START_NAMESPACE - - -//! Implements code for the runtime type system of the ML -ML_CLASS_SOURCE(RTStructure, Base); - - - -ML_END_NAMESPACE Deleted: trunk/Community/General/Sources/ML/MLCSOToRTStructure/RTStructure.h =================================================================== --- trunk/Community/General/Sources/ML/MLCSOToRTStructure/RTStructure.h 2010-08-19 22:11:55 UTC (rev 325) +++ trunk/Community/General/Sources/ML/MLCSOToRTStructure/RTStructure.h 2010-08-19 22:14:08 UTC (rev 326) @@ -1,44 +0,0 @@ -//---------------------------------------------------------------------------------- -//! The ML module class RTStructure. -/*! -// \file RTStructure.h -// \author linal -// \date 2010-01-15 -// -// This is a class to hold RT Structure -*/ -//---------------------------------------------------------------------------------- - - -#ifndef __mlRTStructure_H -#define __mlRTStructure_H -#include "MLCSOToRTStructureSystem.h" -#include "mlBase.h" - -ML_START_NAMESPACE - -class MLCSOTORTSTRUCTURE_EXPORT RTStructure : public Base -{ -public: - RTStructure(void) - { - - } - virtual ~RTStructure(void) - { - - } - - - std::stringstream stream; - -private: - - - ML_CLASS_HEADER(RTStructure) - -}; - -ML_END_NAMESPACE - -#endif This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <li...@us...> - 2010-08-19 22:12:01
|
Revision: 325 http://mevislabmodules.svn.sourceforge.net/mevislabmodules/?rev=325&view=rev Author: linaliu Date: 2010-08-19 22:11:55 +0000 (Thu, 19 Aug 2010) Log Message: ----------- remove unnecessary files Modified Paths: -------------- trunk/Community/General/Sources/ML/MLCSOToRTStructure/MLCSOToRTStructure.pro trunk/Community/General/Sources/ML/MLCSOToRTStructure/mlCSOToRTStructure.h Modified: trunk/Community/General/Sources/ML/MLCSOToRTStructure/MLCSOToRTStructure.pro =================================================================== --- trunk/Community/General/Sources/ML/MLCSOToRTStructure/MLCSOToRTStructure.pro 2010-08-17 23:51:05 UTC (rev 324) +++ trunk/Community/General/Sources/ML/MLCSOToRTStructure/MLCSOToRTStructure.pro 2010-08-19 22:11:55 UTC (rev 325) @@ -29,13 +29,11 @@ HEADERS += \ MLCSOToRTStructureInit.h \ MLCSOToRTStructureSystem.h \ - mlCSOToRTStructure.h \ - RTStructure.h + mlCSOToRTStructure.h SOURCES += \ MLCSOToRTStructureInit.cpp \ - mlCSOToRTStructure.cpp \ - RTStructure.cpp + mlCSOToRTStructure.cpp # additional files that are NOT compiled RELATEDFILES += \ Modified: trunk/Community/General/Sources/ML/MLCSOToRTStructure/mlCSOToRTStructure.h =================================================================== --- trunk/Community/General/Sources/ML/MLCSOToRTStructure/mlCSOToRTStructure.h 2010-08-17 23:51:05 UTC (rev 324) +++ trunk/Community/General/Sources/ML/MLCSOToRTStructure/mlCSOToRTStructure.h 2010-08-19 22:11:55 UTC (rev 325) @@ -32,9 +32,9 @@ #include "DCMTree_Exception.h" #include "DCMTree_Message.h" #include "DCMTree_DicomTags.h" -#include "RTStructure.h" + ML_START_NAMESPACE This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <li...@us...> - 2010-08-17 23:51:11
|
Revision: 324 http://mevislabmodules.svn.sourceforge.net/mevislabmodules/?rev=324&view=rev Author: linaliu Date: 2010-08-17 23:51:05 +0000 (Tue, 17 Aug 2010) Log Message: ----------- Modified Paths: -------------- trunk/Community/General/Sources/ML/MLCSOToRTStructure/mlCSOToRTStructure.cpp Modified: trunk/Community/General/Sources/ML/MLCSOToRTStructure/mlCSOToRTStructure.cpp =================================================================== --- trunk/Community/General/Sources/ML/MLCSOToRTStructure/mlCSOToRTStructure.cpp 2010-08-13 08:11:35 UTC (rev 323) +++ trunk/Community/General/Sources/ML/MLCSOToRTStructure/mlCSOToRTStructure.cpp 2010-08-17 23:51:05 UTC (rev 324) @@ -89,9 +89,6 @@ writeToDCMFile(_genTreePtr, _rtStructFileFld->getStringValue()); } } - }else { - ML_PRINT_ERROR("mlCSOToRTStructure::_HandleNotification",ML_BAD_PARAMETER, "There is no DICOM header information in the provided input image. RTStructure file cannot be generated."); - return; } setValid(this); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rha...@us...> - 2010-08-13 08:11:41
|
Revision: 323 http://mevislabmodules.svn.sourceforge.net/mevislabmodules/?rev=323&view=rev Author: rhameeteman Date: 2010-08-13 08:11:35 +0000 (Fri, 13 Aug 2010) Log Message: ----------- KH. * Removed some obsolete lines Modified Paths: -------------- trunk/Community/General/Sources/ML/MLWEMCommunityModules/WEMCenterOfMass/WEMCenterOfMass.cpp Modified: trunk/Community/General/Sources/ML/MLWEMCommunityModules/WEMCenterOfMass/WEMCenterOfMass.cpp =================================================================== --- trunk/Community/General/Sources/ML/MLWEMCommunityModules/WEMCenterOfMass/WEMCenterOfMass.cpp 2010-08-13 06:10:28 UTC (rev 322) +++ trunk/Community/General/Sources/ML/MLWEMCommunityModules/WEMCenterOfMass/WEMCenterOfMass.cpp 2010-08-13 08:11:35 UTC (rev 323) @@ -140,9 +140,7 @@ if (_inWEM != NULL){ double sumX=0.0, sumY=0.0, sumZ=0.0; int num=0; - Vector3 centroid; double totalArea=0.0; - // Iterate over all nodes and compute sum of x, y and z-position for (unsigned int i = 0; i < _inWEM->getNumWEMPatches(); i++){ WEMPatch* wemPatch = _inWEM->getWEMPatchAt(i); const unsigned int numNodesInPatch = wemPatch->getNumNodes(); @@ -165,12 +163,12 @@ sumY+=centroid[1]*area; sumZ+=centroid[2]*area; totalArea += area; - ++num; } if (!isTrangle){ delete trianglePatch; } } else { + // Iterate over all nodes and compute sum of x, y and z-position for (unsigned int j = 0; j < numNodesInPatch; j++){ WEMNode* node = wemPatch->getNodeAt(j); float x, y, z; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rha...@us...> - 2010-08-13 06:10:34
|
Revision: 322 http://mevislabmodules.svn.sourceforge.net/mevislabmodules/?rev=322&view=rev Author: rhameeteman Date: 2010-08-13 06:10:28 +0000 (Fri, 13 Aug 2010) Log Message: ----------- KH. * corrected small typo in field name. Modified Paths: -------------- trunk/Community/General/Modules/ML/MLCMCoordinate/MLCMCoordinate.def Modified: trunk/Community/General/Modules/ML/MLCMCoordinate/MLCMCoordinate.def =================================================================== --- trunk/Community/General/Modules/ML/MLCMCoordinate/MLCMCoordinate.def 2010-08-13 06:08:54 UTC (rev 321) +++ trunk/Community/General/Modules/ML/MLCMCoordinate/MLCMCoordinate.def 2010-08-13 06:10:28 UTC (rev 322) @@ -63,16 +63,16 @@ Label { title = "Box0:" alignGroupX = c1 } ButtonBar inputMode0 { show = Radio } CheckBox correctInput0 { title = Correct } - CheckBox w2VInput0 { title = w2v } - CheckBox v2WInput0 { title = v2w } + CheckBox W2VInput0 { title = w2v } + CheckBox V2WInput0 { title = v2w } } Horizontal { alignX = Left Label { title = "Box1:" alignGroupX = c1 } ButtonBar inputMode1 { show = Radio } CheckBox correctInput1 { title = Correct } - CheckBox w2VInput1 { title = w2v } - CheckBox v2WInput1 { title = v2w } + CheckBox W2VInput1 { title = w2v } + CheckBox V2WInput1 { title = v2w } } } Box "Scalar Input" { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rha...@us...> - 2010-08-13 06:09:00
|
Revision: 321 http://mevislabmodules.svn.sourceforge.net/mevislabmodules/?rev=321&view=rev Author: rhameeteman Date: 2010-08-13 06:08:54 +0000 (Fri, 13 Aug 2010) Log Message: ----------- KH. * Added the option to calculate the centroid scaled by the area of the faces in stead of the node positions. This should be more accurate for non equally spaces nodes. Modified Paths: -------------- trunk/Community/General/Modules/ML/MLWEMCommunityModules/MLWEMCommunityModules.def trunk/Community/General/Sources/ML/MLWEMCommunityModules/WEMCenterOfMass/WEMCenterOfMass.cpp trunk/Community/General/Sources/ML/MLWEMCommunityModules/WEMCenterOfMass/WEMCenterOfMass.h Modified: trunk/Community/General/Modules/ML/MLWEMCommunityModules/MLWEMCommunityModules.def =================================================================== --- trunk/Community/General/Modules/ML/MLWEMCommunityModules/MLWEMCommunityModules.def 2010-08-13 06:02:20 UTC (rev 320) +++ trunk/Community/General/Modules/ML/MLWEMCommunityModules/MLWEMCommunityModules.def 2010-08-13 06:08:54 UTC (rev 321) @@ -148,6 +148,13 @@ expandX = True } + Field useSurface { + tooltip = +"If checked the centroid is calculated through a +weighted average of the centroids of all faces. Otherwise +the centroid is the average of the node positions" + } + //Separator { direction = horizontal } //Horizontal { Modified: trunk/Community/General/Sources/ML/MLWEMCommunityModules/WEMCenterOfMass/WEMCenterOfMass.cpp =================================================================== --- trunk/Community/General/Sources/ML/MLWEMCommunityModules/WEMCenterOfMass/WEMCenterOfMass.cpp 2010-08-13 06:02:20 UTC (rev 320) +++ trunk/Community/General/Sources/ML/MLWEMCommunityModules/WEMCenterOfMass/WEMCenterOfMass.cpp 2010-08-13 06:08:54 UTC (rev 321) @@ -65,6 +65,9 @@ _inverseCenterOfMass = fieldC->addVec3f("inverseCenterOfMass"); _inverseCenterOfMass->setVec3fValue(vec3(0.0,0.0,0.0)); + _useSurface = fieldC->addBool("useSurface"); + _useSurface->setBoolValue( false ); + // Reactivate calls of handleNotification on field changes. handleNotificationOn(); } @@ -86,8 +89,9 @@ //---------------------------------------------------------------------------------- void WEMCenterOfMass::handleNotification (Field *field) { - ML_TRACE_IN("WEMCenterOfMass::handleNotification()") + ML_TRACE_IN("WEMCenterOfMass::handleNotification()"); + if ( field == _useSurface ) { this->_process(); } // call parent class and handle apply/autoApply and in/outputs WEMInspector::handleNotification(field); } @@ -136,23 +140,56 @@ if (_inWEM != NULL){ double sumX=0.0, sumY=0.0, sumZ=0.0; int num=0; + Vector3 centroid; + double totalArea=0.0; // Iterate over all nodes and compute sum of x, y and z-position for (unsigned int i = 0; i < _inWEM->getNumWEMPatches(); i++){ WEMPatch* wemPatch = _inWEM->getWEMPatchAt(i); const unsigned int numNodesInPatch = wemPatch->getNumNodes(); - for (unsigned int j = 0; j < numNodesInPatch; j++){ - WEMNode* node = wemPatch->getNodeAt(j); - float x, y, z; - node->getPosition(x, y, z); - sumX+=x; - sumY+=y; - sumZ+=z; - ++num; + if ( _useSurface->getBoolValue() ){ + WEMTrianglePatch * trianglePatch; + bool isTrangle = true; + if (_inWEM->getWEMPatchAt(i)->getPatchType() != WEM_PATCH_TRIANGLES ){ + trianglePatch = new WEMTrianglePatch; + isTrangle = false; + wemPatch->triangulate( trianglePatch, WEM_TRIANGULATION_CENTER ); + } else { + trianglePatch = (WEMTrianglePatch*)_inWEM->getWEMPatchAt(i); + } + unsigned int nFaces = trianglePatch->getNumFaces(); + for (unsigned int j = 0; j < nFaces; j++){ + WEMFace* face = trianglePatch->getFaceAt(j); + double area = face->getArea(); + Vector3 centroid = face->getCentroid(); + sumX+=centroid[0]*area; + sumY+=centroid[1]*area; + sumZ+=centroid[2]*area; + totalArea += area; + ++num; + } + if (!isTrangle){ + delete trianglePatch; + } + } else { + for (unsigned int j = 0; j < numNodesInPatch; j++){ + WEMNode* node = wemPatch->getNodeAt(j); + float x, y, z; + node->getPosition(x, y, z); + sumX+=x; + sumY+=y; + sumZ+=z; + ++num; + } } } // Set output fields - _centerOfMass->setVec3fValue(vec3(sumX/double(num), sumY/double(num), sumZ/double(num))); - _inverseCenterOfMass->setVec3fValue(-vec3(sumX/double(num), sumY/double(num), sumZ/double(num))); + if ( _useSurface->getBoolValue() ){ + _centerOfMass->setVec3fValue( vec3(sumX/totalArea, sumY/totalArea, sumZ/totalArea) ); + _inverseCenterOfMass->setVec3fValue( -vec3(sumX/totalArea, sumY/totalArea, sumZ/totalArea) ); + } else { + _centerOfMass->setVec3fValue(vec3(sumX/double(num), sumY/double(num), sumZ/double(num))); + _inverseCenterOfMass->setVec3fValue(-vec3(sumX/double(num), sumY/double(num), sumZ/double(num))); + } } else { // Reset output fields _centerOfMass->setVec3fValue(vec3()); Modified: trunk/Community/General/Sources/ML/MLWEMCommunityModules/WEMCenterOfMass/WEMCenterOfMass.h =================================================================== --- trunk/Community/General/Sources/ML/MLWEMCommunityModules/WEMCenterOfMass/WEMCenterOfMass.h 2010-08-13 06:02:20 UTC (rev 320) +++ trunk/Community/General/Sources/ML/MLWEMCommunityModules/WEMCenterOfMass/WEMCenterOfMass.h 2010-08-13 06:08:54 UTC (rev 321) @@ -63,6 +63,7 @@ //! Constructor. WEMCenterOfMass (std::string type="WEMCenterOfMass"); + protected: //! Destructor. @@ -86,6 +87,8 @@ //! Center of mass (and its inverse) output field Vec3fField *_centerOfMass, *_inverseCenterOfMass; + //! Calculate the center of mass using the area of the face associated with the nodes + BoolField *_useSurface; //@} //! The main processing routine. Here, the own mesh algorithm can be implemented. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rha...@us...> - 2010-08-13 06:02:27
|
Revision: 320 http://mevislabmodules.svn.sourceforge.net/mevislabmodules/?rev=320&view=rev Author: rhameeteman Date: 2010-08-13 06:02:20 +0000 (Fri, 13 Aug 2010) Log Message: ----------- KH. * Added totalSum, totalAverage, totalMin, totalMax as output statistics * some minor bug fixes Modified Paths: -------------- trunk/Community/General/Modules/ML/MLCSOCommunityModules/MLCSOCommunityModules.def trunk/Community/General/Sources/ML/MLCSOCommunityModules/CSOImageStatistics/mlCSOImageStatistics.cpp trunk/Community/General/Sources/ML/MLCSOCommunityModules/CSOImageStatistics/mlCSOImageStatistics.h Modified: trunk/Community/General/Modules/ML/MLCSOCommunityModules/MLCSOCommunityModules.def =================================================================== --- trunk/Community/General/Modules/ML/MLCSOCommunityModules/MLCSOCommunityModules.def 2010-08-11 09:43:26 UTC (rev 319) +++ trunk/Community/General/Modules/ML/MLCSOCommunityModules/MLCSOCommunityModules.def 2010-08-13 06:02:20 UTC (rev 320) @@ -74,6 +74,13 @@ exampleNetwork = $(LOCAL)/CSOImageStatistics/CSOImageStatisticsExample.mlab documentation = "$(LOCAL)/CSOImageStatistics/CSOImageStatistics.html" + Description { + Field totalSum { persistent = No } + Field totalAverage { persistent = No } + Field totalMin { persistent = No } + Field totalMax { persistent = No } + Field statistics { persistent = No } + } Window { Vertical "Main" { @@ -110,9 +117,23 @@ Vertical Statistics { expandY = Yes - ListView statistics { + Box Totals { + layout = Horizontal + Vertical { + Field totalSum { edit = No } + Field totalAverage { edit = No } + } + Vertical { + Field totalMin { edit = No } + Field totalMax { edit = No } + } + } + Box Table { expandY = Yes - columnSeparator = ";" + ListView statistics { + expandY = Yes + columnSeparator = ";" + } } } // Vertical Statistics Modified: trunk/Community/General/Sources/ML/MLCSOCommunityModules/CSOImageStatistics/mlCSOImageStatistics.cpp =================================================================== --- trunk/Community/General/Sources/ML/MLCSOCommunityModules/CSOImageStatistics/mlCSOImageStatistics.cpp 2010-08-11 09:43:26 UTC (rev 319) +++ trunk/Community/General/Sources/ML/MLCSOCommunityModules/CSOImageStatistics/mlCSOImageStatistics.cpp 2010-08-13 06:02:20 UTC (rev 320) @@ -113,6 +113,18 @@ f_Statistics = fieldC->addString("statistics"); f_Statistics->setStringValue( "Id;Voxels;Sum;Average" ); + f_TotalSum = fieldC->addDouble( "totalSum" ); + f_TotalSum->setDoubleValue( 0.0 ); + + f_TotalAverage = fieldC->addDouble( "totalAverage" ); + f_TotalAverage->setDoubleValue( 0.0 ); + + f_TotalMin = fieldC->addDouble( "totalMin" ); + f_TotalMin->setDoubleValue( 0.0 ); + + f_TotalMax = fieldC->addDouble( "totalMax" ); + f_TotalMax->setDoubleValue( 0.0 ); + const char* funcNames[] = {"NearestNeighbor", "Trilinear" , "TrilinearSkipBorder"}; f_InterpolationMode = getFieldContainer()->addEnum("interpolation",funcNames,3); f_InterpolationMode->setEnumValue(1); @@ -330,16 +342,35 @@ if (m_SelectedCSOIds.size() > 0){ + double totalMin = ML_DOUBLE_MAX; + double totalMax = ML_DOUBLE_MIN; + double totalAverage = 0.0; + double totalSum = 0.0; + double totalArea = 0.0; for (unsigned int i = 0; i < m_SelectedCSOIds.size(); i++){ const unsigned int currentId = m_SelectedCSOIds[i]; CSO* currentCSO = m_OutCSOList->getCSOById(currentId); if ( !currentCSO->isClosed() ){ continue; } double sum = 0.0; double average = 0.0; + double minimum = ML_DOUBLE_MAX; + double maximum = ML_DOUBLE_MIN; unsigned int iD = currentCSO->getId(); - double voxelCount; - this->GetStatistics( currentCSO, voxelCount, sum, average ); + size_t voxelCount; + this->GetStatistics( currentCSO, voxelCount, sum, average, minimum, maximum ); + totalSum += sum; + double currentArea = 0.0; + if (f_UseAllPointsInsideCSO->getBoolValue() ){ + currentArea = currentCSO->getArea(); + } else { + currentArea = currentCSO->getLength(); + } + totalAverage += average*currentArea; + totalArea += currentArea; + totalMin = ML_MIN(totalMin,minimum); + totalMax = ML_MAX(totalMax,maximum); + outputString << iD << ";" << voxelCount << ";" << sum << ";" << average << std::endl; m_SumSeries.push_back( sum ); @@ -357,8 +388,16 @@ currentCSO->setDescription( descriptionString ); } } //iD list + if ( totalArea ){ + totalAverage /= totalArea; + } else { + totalAverage = 0.0; + } + f_TotalSum->setDoubleValue( totalSum ); + f_TotalAverage->setDoubleValue( totalAverage ); + f_TotalMin->setDoubleValue( totalMin ); + f_TotalMax->setDoubleValue( totalMax ); - // Set Notification flags notificationFlag |= CSOList::NOTIFICATION_CSO_FINISHED; notificationFlag |= CSOList::NOTIFICATION_GROUP_FINISHED; @@ -379,33 +418,13 @@ } -void CSOImageStatistics::SetCurves() +void CSOImageStatistics::GetStatistics( CSO* cso, + size_t &voxelCount, + double &sum, + double &average, + double &minimum, + double &maximum ) { - // Remove any existing curves - while ( !m_OutCurveList->getCurveList().empty() ) { - delete m_OutCurveList->getCurveList().back(); - m_OutCurveList->getCurveList().pop_back(); - } - - // Set Curve output - if ( f_OutputCurve->getBoolValue() ) { - if ( f_OutputSum->getBoolValue() ) { - CurveData *outputCurve = new CurveData; - outputCurve->setY( m_SumSeries.size(), &m_SumSeries[0], 1 ); - m_OutCurveList->getCurveList().push_back( outputCurve ); - } - if ( f_OutputAverage->getBoolValue() ) { - CurveData *outputCurve = new CurveData; - outputCurve->setY( m_AverageSeries.size(), &m_AverageSeries[0], 1 ); - m_OutCurveList->getCurveList().push_back( outputCurve ); - } - } - f_OutCurveList->notifyAttachments(); -} - - -void CSOImageStatistics::GetStatistics( CSO* cso, double &voxelCount, double &sum, double &average ) -{ if ( cso && getNonDummyUpdatedInImg(0) && cso->isInPlane() ){ // Create a MPRLight module @@ -503,68 +522,93 @@ &tile ); double* inputTile = reinterpret_cast< double* >(tile); + sum = 0.0; + average = 0.0; + voxelCount = 0; + minimum = ML_DOUBLE_MAX; + maximum = ML_DOUBLE_MIN; + // Remove data on error to avoid memory leaks. - if (inputTile && (err != ML_RESULT_OK)){ - if (inputTile) freeTile(inputTile); - inputTile = NULL; - } + if (inputTile ) { + if (err != ML_RESULT_OK) { + freeTile(inputTile); + inputTile = NULL; + } else { - if (inputTile ){ + std::vector< vec3 > contourPoints; - std::vector< vec3 > contourPoints; + // Convert pathPoints to voxel coordinates + ConvertCoorinateList( pathPoints, mprOutput); + if ( f_UseAllPointsInsideCSO->getBoolValue() ){ + // Fill contourPoints with all points inside the contour + GetPointsInsideContour( pathPoints, contourPoints, csoVoxelBox); + } else { + // Use just the pathPoints + contourPoints.swap( pathPoints ); + } - // Convert pathPoints to voxel coordinates - ConvertCoorinateList( pathPoints, mprOutput); - if ( f_UseAllPointsInsideCSO->getBoolValue() ){ - // Fill contourPoints with all points inside the contour - GetPointsInsideContour( pathPoints, contourPoints, csoVoxelBox); - } else { - // Use just the pathPoints - contourPoints.swap( pathPoints ); - } + voxelCount = contourPoints.size(); + const Vector strideVector = csoVoxelBox.getExt().getStrides(); + const int currentCSOIndex = cso->getCSOList()->getCSOIndex( cso ); + for ( unsigned int iPos = 0; iPos < voxelCount; ++iPos){ + const MLint x0 = static_cast< MLint >(contourPoints[iPos][0]); + const MLint y0 = static_cast< MLint >(contourPoints[iPos][1]); + const MLint z0 = static_cast< MLint >(contourPoints[iPos][2]); + const Vector currentPos( x0,y0,z0,0,0,0 ); + const Vector deltaPos = currentPos-csoVoxelBox.v1; + const MLint offset = deltaPos.dot( strideVector); + double* currentValue = inputTile+offset; + sum += *currentValue; + minimum = ML_MIN(minimum, *currentValue ); + maximum = ML_MAX(maximum, *currentValue ); + float x,y,z; + MLImageMapVoxelToWorld(mprOutput, currentPos[0]+0.5,currentPos[1]+0.5,currentPos[2]+0.5,&x,&y,&z); + XMarker currentMarker( vec3(x,y,z) ); + currentMarker.type = currentCSOIndex; + m_OutMarkerList->push_back( currentMarker ); + } - if ( contourPoints.size() == 0 ){ - voxelCount = -1; - sum = 1; - } - const Vector strideVector = csoVoxelBox.getExt().getStrides(); - const int currentCSOIndex = cso->getCSOList()->getCSOIndex( cso ); - for ( unsigned int iPos = 0; iPos < contourPoints.size(); ++iPos){ - const MLint x0 = static_cast< MLint >(contourPoints[iPos][0]); - const MLint y0 = static_cast< MLint >(contourPoints[iPos][1]); - const MLint z0 = static_cast< MLint >(contourPoints[iPos][2]); - const Vector currentPos( x0, y0,z0,0,0,0 ); - const Vector deltaPos = currentPos-csoVoxelBox.v1; - const MLint offset = deltaPos.dot( strideVector); - double* currentValue = inputTile+offset; - sum += *currentValue; - float x,y,z; - MLImageMapVoxelToWorld(mprOutput, currentPos[0],currentPos[1],currentPos[2]+0.5,&x,&y,&z); - XMarker currentMarker( vec3(x,y,z) ); - currentMarker.type = currentCSOIndex; - m_OutMarkerList->push_back( currentMarker ); - } - - - const double csoArea = cso->getArea(); - voxelCount = contourPoints.size(); - if ( voxelCount != 0 && csoArea != 0){ - if ( f_UseVoxelSize->getBoolValue() ){ - average = sum/csoArea; + const double csoArea = cso->getArea(); + const double csoLength = cso->getLength(); + if ( csoLength != 0 && csoArea != 0){ + if ( f_UseVoxelSize->getBoolValue() ){ + average = sum/csoArea; + } else { + average = sum/csoLength; + } } else { - average = sum/voxelCount; + average = 0; } - } else { - average = 0; } + freeTile( inputTile ); } - freeTile( inputTile ); - } else { - sum = 0.0; - average = 0.0; - voxelCount = 0.0; + } } + + +void CSOImageStatistics::SetCurves() +{ + // Remove any existing curves + while ( !m_OutCurveList->getCurveList().empty() ) { + delete m_OutCurveList->getCurveList().back(); + m_OutCurveList->getCurveList().pop_back(); + } + + // Set Curve output + if ( f_OutputCurve->getBoolValue() ) { + if ( f_OutputSum->getBoolValue() ) { + CurveData *outputCurve = new CurveData; + outputCurve->setY( m_SumSeries.size(), &m_SumSeries[0], 1 ); + m_OutCurveList->getCurveList().push_back( outputCurve ); + } + if ( f_OutputAverage->getBoolValue() ) { + CurveData *outputCurve = new CurveData; + outputCurve->setY( m_AverageSeries.size(), &m_AverageSeries[0], 1 ); + m_OutCurveList->getCurveList().push_back( outputCurve ); + } + } + f_OutCurveList->notifyAttachments(); } Modified: trunk/Community/General/Sources/ML/MLCSOCommunityModules/CSOImageStatistics/mlCSOImageStatistics.h =================================================================== --- trunk/Community/General/Sources/ML/MLCSOCommunityModules/CSOImageStatistics/mlCSOImageStatistics.h 2010-08-11 09:43:26 UTC (rev 319) +++ trunk/Community/General/Sources/ML/MLCSOCommunityModules/CSOImageStatistics/mlCSOImageStatistics.h 2010-08-13 06:02:20 UTC (rev 320) @@ -88,7 +88,12 @@ void ProcessCSOList(bool shouldSetupInternalCSOList); //! Get image statistics of cso - void GetStatistics(CSO* cso, double &voxelCount, double &sum, double &average ); + void GetStatistics( CSO* cso, + size_t &voxelCount, + double &sum, + double &average, + double &minimum, + double &maximum); //! Get a list of all points inside the contour defined by the pathPoints //! The contour should be axis aligned @@ -192,6 +197,11 @@ //! String containing all calculated statistics StringField *f_Statistics; + DoubleField *f_TotalSum; + DoubleField *f_TotalAverage; + DoubleField *f_TotalMin; + DoubleField *f_TotalMax; + //! mode defines the resampling filter that is applied ("NearestNeighbor", "Trilinear" , "TrilinearSkipBorder") EnumField *f_InterpolationMode; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bro...@us...> - 2010-08-11 09:43:32
|
Revision: 319 http://mevislabmodules.svn.sourceforge.net/mevislabmodules/?rev=319&view=rev Author: broersen Date: 2010-08-11 09:43:26 +0000 (Wed, 11 Aug 2010) Log Message: ----------- - Improved copying of WEM structure to Matlab - Added clearing of vector variables after error Modified Paths: -------------- trunk/Community/General/Sources/ML/MLMatlabScriptWrapper/mlMatlabScriptWrapper.cpp Modified: trunk/Community/General/Sources/ML/MLMatlabScriptWrapper/mlMatlabScriptWrapper.cpp =================================================================== --- trunk/Community/General/Sources/ML/MLMatlabScriptWrapper/mlMatlabScriptWrapper.cpp 2010-08-10 13:44:49 UTC (rev 318) +++ trunk/Community/General/Sources/ML/MLMatlabScriptWrapper/mlMatlabScriptWrapper.cpp 2010-08-11 09:43:26 UTC (rev 319) @@ -170,7 +170,7 @@ #if defined(MACOS) if (m_startCmd.empty()) { - // Try to locate matlab binary in PATH environment + // Try to locate Matlab binary in PATH environment const char *pathEnv = getenv("PATH"); if (pathEnv) { std::istringstream pathList(pathEnv); @@ -187,7 +187,7 @@ } if (m_startCmd.empty()) { - // Try to locate matlab binary via its bundle id + // Try to locate Matlab binary via its bundle id std::string matlabBundle = macx::Bundle::getBundleDirectory("com.mathworks.StartMATLAB"); if (! matlabBundle.empty()) { std::string path = matlabBundle + "/bin/matlab"; @@ -719,6 +719,11 @@ clearString << _stringNameFld[i]->getStringValue() << " "; } + // Clear vectors + for(int i=0; i<6; i++) { + clearString << _vectorNameFld[i]->getStringValue() << " "; + } + // Clear matrices for(int i=0; i<3; i++) { clearString << _matrixNameFld[i]->getStringValue() << " "; @@ -750,7 +755,7 @@ engEvalString(m_pEngine, clearString.str().c_str()); } -//! Copy input image data to matlab. +//! Copy input image data to Matlab. void MatlabScriptWrapper::_copyInputImageDataToMatlab() { if (!_checkMatlabIsStarted()) @@ -840,7 +845,7 @@ } } -//! Copy input XMarkerList to matlab. +//! Copy input XMarkerList to Matlab. void MatlabScriptWrapper::_copyInputXMarkerToMatlab() { if (!_checkMatlabIsStarted()) @@ -985,7 +990,7 @@ } } -//! Copy input WEM to matlab. +//! Copy input WEM to Matlab. void MatlabScriptWrapper::_copyInputWEMToMatlab() { if (!_checkMatlabIsStarted()) @@ -1081,27 +1086,13 @@ std::ostringstream all; all << setNodes.str() << "\n" << setFaces.str() << "\n" << setNormals.str() << "\n" << setLUT.str() << "\n"; - mwSize mw_dims = mwSize(2); - mwSize* mw_sz = new mwSize[2]; - mw_sz[0] = all.str().length()+1; - mw_sz[1] = 1; - - mxArray * m_X = mxCreateCharArray(mw_dims,mw_sz); - delete mw_sz; - - if (m_X) { - memcpy( mxGetData( m_X ),(void*)(all.str().c_str()), all.str().length()+1); + mxArray *m_X = mxCreateString(all.str().c_str()); + if (m_X) { if (engPutVariable(m_pEngine, "copyInputWEMToMatlab", m_X) == 0) { engEvalString(m_pEngine, "eval(copyInputWEMToMatlab); clear copyInputWEMToMatlab;"); } - mxDestroyArray(m_X); } - - // Put WEM into matlab structure. - //engEvalString(m_pEngine, setNodes.str().c_str()); std::cout << "nodes" << std::endl; - //engEvalString(m_pEngine, setFaces.str().c_str()); std::cout << "faces" << std::endl; - //engEvalString(m_pEngine, setNormals.str().c_str()); std::cout << "normals" << std::endl; - //engEvalString(m_pEngine, setLUT.str().c_str()); std::cout << "lut" << std::endl; + mxDestroyArray(m_X); m_X = NULL; } //! Gets structure from Matlab and copies results into output WEM. @@ -1137,16 +1128,22 @@ // Get nodes executeStr << "tmpOutWEMNodes=" << outWEMStr << "{" << j << "}" << ".Vertices"; engEvalString(m_pEngine, executeStr.str().c_str()); + // Get array from Matlab. mxArray *m_nodes = engGetVariable(m_pEngine, "tmpOutWEMNodes"); + // Delete temp data. engEvalString(m_pEngine, "clear tmpOutWEMNodes"); + // Clear temp string. executeStr.str(""); // Get faces executeStr << "tmpOutWEMFaces=" << outWEMStr << "{" << j << "}" << ".Faces-1"; engEvalString(m_pEngine, executeStr.str().c_str()); + // Get faces from Matlab. mxArray *m_faces = engGetVariable(m_pEngine, "tmpOutWEMFaces"); + // Delete temp data. engEvalString(m_pEngine, "clear tmpOutWEMFaces"); - executeStr.str(""); + // Clear temp string. + executeStr.str(""); // Get data from Matlab array. if (m_nodes && !mxIsEmpty(m_nodes) && mxGetClassID(m_nodes) == mxDOUBLE_CLASS) @@ -1183,7 +1180,7 @@ triPatch->computeNormals(); _outWEM->addWEMPatch(triPatch); - } + } } mxDestroyArray(m_nodes); mxDestroyArray(m_faces); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bro...@us...> - 2010-08-10 13:44:55
|
Revision: 318 http://mevislabmodules.svn.sourceforge.net/mevislabmodules/?rev=318&view=rev Author: broersen Date: 2010-08-10 13:44:49 +0000 (Tue, 10 Aug 2010) Log Message: ----------- - Changed 'LUT' fieldname into 'FaceVertexCData' for compatibility with the Matlab structure for its patch-type Modified Paths: -------------- trunk/Community/General/Sources/ML/MLMatlabScriptWrapper/mlMatlabScriptWrapper.cpp Modified: trunk/Community/General/Sources/ML/MLMatlabScriptWrapper/mlMatlabScriptWrapper.cpp =================================================================== --- trunk/Community/General/Sources/ML/MLMatlabScriptWrapper/mlMatlabScriptWrapper.cpp 2010-08-10 13:15:10 UTC (rev 317) +++ trunk/Community/General/Sources/ML/MLMatlabScriptWrapper/mlMatlabScriptWrapper.cpp 2010-08-10 13:44:49 UTC (rev 318) @@ -80,13 +80,13 @@ (_inputWEMFld = fields->addBase("inputWEM"))->setBaseValue(NULL); (_outputWEMFld = fields->addBase("outputWEM"))->setBaseValue(_outWEM); - //! Use matlab commands in text field. + //! Use Matlab commands in text field. (_matlabScriptFld = fields->addString("matlabScript"))->setStringValue("Output0=Input0 % Type your matlab script here."); - //! Use external matlab script. + //! Use external Matlab script. (_useExternalScriptFld = fields->addBool("useExternalScript"))->setBoolValue(false); - //! Where will matlab script be dumped. + //! Where will Matlab script be dumped. (_matlabScriptPathFld = fields->addString("matlabScriptPath"))->setStringValue(""); //! Set input and output data names used in matlab. @@ -380,7 +380,7 @@ _getWEMBackFromMatlab(); - // Get scalars back from matlab. First store the current scalars so that + // Get scalars back from Matlab. First store the current scalars so that // we can check if they change. A notification is only sent upon change. double tmpScalars[6]; for(int k=0; k<6; ++k) { @@ -392,7 +392,7 @@ _scalarFld[k]->notifyAttachments(); } } - // Get strings back from matlab. First store the current strings so that + // Get strings back from Matlab. First store the current strings so that // we can check if they change. A notification is only sent upon change. std::string tmpstrings[6]; for(int k=0; k<6; ++k) { @@ -405,7 +405,7 @@ } } - // Get vectors back from matlab. First store the current vectors so that + // Get vectors back from Matlab. First store the current vectors so that // we can check if they change. A notification is only sent upon change. for(int k=0; k<6; ++k) { tmpstrings[k] = _vectorFld[k]->getStringValue(); @@ -417,7 +417,7 @@ } } - // Get matrices back from matlab. First store the current matrices so that + // Get matrices back from Matlab. First store the current matrices so that // we can check if they change. A notification is only sent upon change. for(int k=0; k<3; ++k) { tmpstrings[k] = _matrixFld[k]->getStringValue(); @@ -446,7 +446,7 @@ WEM_NOTIFICATION_REPAINT; ecList.push_back(ec); - _outWEM->notifyObservers(ecList); + _outWEM->notifyObservers(ecList); } } @@ -902,12 +902,12 @@ size_t i=0, j=0; // Get names from GUI. std::string outXMarkerStr = _outXMarkerNameFld->getStringValue(); - // Compose temp string to execute in matlab. + // Compose temp string to execute in Matlab. std::ostringstream executeStr; - // Internal temp variable will be used in matlab. + // Internal temp variable will be used in Matlab. executeStr << "tmpOutXMarkerListPos=" << outXMarkerStr << ".pos"; engEvalString(m_pEngine, executeStr.str().c_str()); - // Get array from matlab. + // Get array from Matlab. mxArray *m_pos = engGetVariable(m_pEngine, "tmpOutXMarkerListPos"); // Delete temp data. engEvalString(m_pEngine, "clear tmpOutXMarkerListPos"); @@ -943,7 +943,7 @@ for(i=0; i<rows; i++) { // Fill marker with zeros. - XMarker outMarker(vec6(0),vec3(0),0); + XMarker outMarker(vec3(0)); // Write matlab points to marker and prevent writing more than 6 dimensions for(j=0; j<cols && cols<=6; j++) { @@ -970,7 +970,8 @@ } } - // Append XMarker to XMarkerList. + // Append XMarker to XMarkerList with new Id. + outMarker.setId(_outputXMarkerList.newId()); _outputXMarkerList.push_back(outMarker); } @@ -999,6 +1000,7 @@ // Internal loop. unsigned int i = 0, j = 0, k = 0, m = 0; unsigned int totalNumNodes = 0, numTriangulatedNodes = 0; + WEMPatch *patch = NULL; WEMNode *node = NULL; WEMFace *face = NULL; Vector3 position = NULL_VEC; @@ -1013,11 +1015,11 @@ setNodes << inWEMStr.c_str() << "{1}.Vertices=["; setFaces << inWEMStr.c_str() << "{1}.Faces=["; setNormals << inWEMStr.c_str() << "{1}.VertexNormals=["; - setLUT << inWEMStr.c_str() << "{1}.LUT=["; + setLUT << inWEMStr.c_str() << "{1}.FaceVertexCData=["; // Loop over all patches -> flatten WEM for (i = 0; i < inputWEM->getNumWEMPatches(); i ++) { - WEMPatch *patch = inputWEM->getWEMPatchAt(i); + patch = inputWEM->getWEMPatchAt(i); // Loop over all nodes const unsigned int numNodes = patch->getNumNodes(); @@ -1065,7 +1067,7 @@ const unsigned int numValues = pvl->getNumValues(); for (j = 0; j < numValues; j ++) { setLUT << pvl->getValue(j) << ";"; - } + } } totalNumNodes += numNodes + numTriangulatedNodes; @@ -1094,7 +1096,7 @@ } mxDestroyArray(m_X); } - + // Put WEM into matlab structure. //engEvalString(m_pEngine, setNodes.str().c_str()); std::cout << "nodes" << std::endl; //engEvalString(m_pEngine, setFaces.str().c_str()); std::cout << "faces" << std::endl; @@ -1202,16 +1204,16 @@ MLint i = 0; // Compose string that contains input scalars. std::ostringstream execute; - // Put only input scalars into matlab. + // Put only input scalars into Matlab. for(i=0; i<6; i++) { execute<<_scalarNameFld[i]->getStringValue()<<"="<<(_scalarFld[i]->getDoubleValue())<<"\n"; } - // Execute string and write input scalars into matlab. + // Execute string and write input scalars into Matlab. engEvalString(m_pEngine, execute.str().c_str()); } -//! Copies scalar values from matlab. +//! Copies scalar values from Matlab. void MatlabScriptWrapper::_getScalarsBackFromMatlab() { // Check if Matlab is started. @@ -1239,7 +1241,7 @@ mxDestroyArray(temp); temp = NULL; } -//! Copies string values to matlab. +//! Copies string values to Matlab. void MatlabScriptWrapper::_copyInputStringsToMatlab() { // Check if Matlab is started. @@ -1257,11 +1259,11 @@ { execute<<_stringNameFld[i]->getStringValue()<<"='"<<(_stringFld[i]->getStringValue())<<"'\n"; } - // Execute string and write input scalars into matlab. + // Execute string and write input scalars into Matlab. engEvalString(m_pEngine, execute.str().c_str()); } -//! Copies string values from matlab. +//! Copies string values from Matlab. void MatlabScriptWrapper::_getStringsBackFromMatlab() { // Check if Matlab is started. @@ -1291,7 +1293,7 @@ mxDestroyArray(temp); temp = NULL; } -//! Copy input vectors to matlab. +//! Copy input vectors to Matlab. void MatlabScriptWrapper::_copyInputVectorsToMatlab() { // Proof if Matlab is started. @@ -1304,7 +1306,7 @@ MLint i = 0; // Compose string that contains input vectors. std::ostringstream execute; - // Put only input vectors into matlab. + // Put only input vectors into Matlab. for(i=0; i<6; i++) { execute<<_vectorNameFld[i]->getStringValue()<<"=["; @@ -1313,11 +1315,11 @@ execute<<vec[0]<<","<<vec[1]<<","<<vec[2]<<","<<vec[3]; execute<<"];"; } - // Execute string and write input vectors into matlab. + // Execute string and write input vectors into Matlab. engEvalString(m_pEngine, execute.str().c_str()); } -//! Copies vector values from matlab. +//! Copies vector values from Matlab. void MatlabScriptWrapper::_getVectorsBackFromMatlab() { // Check if Matlab is started. @@ -1349,7 +1351,7 @@ mxDestroyArray(temp); temp = NULL; } -//! Copy input matrices to matlab. +//! Copy input matrices to Matlab. void MatlabScriptWrapper::_copyInputMatricesToMatlab() { // Proof if Matlab is started. @@ -1362,7 +1364,7 @@ MLint i = 0; // Compose string that contains input matrices. std::ostringstream execute; - // Put only input matrices into matlab. + // Put only input matrices into Matlab. for(i=0; i<3; i++) { execute<<_matrixNameFld[i]->getStringValue()<<"=["; @@ -1374,11 +1376,11 @@ execute<<mat[3][0]<<","<<mat[3][1]<<","<<mat[3][2]<<","<<mat[3][3]; execute<<"];"; } - // Execute string and write input matrices into matlab. + // Execute string and write input matrices into Matlab. engEvalString(m_pEngine, execute.str().c_str()); } -//! Copies matrix values from matlab. +//! Copies matrix values from Matlab. void MatlabScriptWrapper::_getMatricesBackFromMatlab() { // Check if Matlab is started. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bar...@us...> - 2010-08-10 13:15:19
|
Revision: 317 http://mevislabmodules.svn.sourceforge.net/mevislabmodules/?rev=317&view=rev Author: bartdedobbelaer Date: 2010-08-10 13:15:10 +0000 (Tue, 10 Aug 2010) Log Message: ----------- - Bug fix: mem leak Modified Paths: -------------- trunk/Community/General/Sources/ML/MLMatlabScriptWrapper/mlMatlabScriptWrapper.cpp Modified: trunk/Community/General/Sources/ML/MLMatlabScriptWrapper/mlMatlabScriptWrapper.cpp =================================================================== --- trunk/Community/General/Sources/ML/MLMatlabScriptWrapper/mlMatlabScriptWrapper.cpp 2010-08-10 13:12:18 UTC (rev 316) +++ trunk/Community/General/Sources/ML/MLMatlabScriptWrapper/mlMatlabScriptWrapper.cpp 2010-08-10 13:15:10 UTC (rev 317) @@ -1092,6 +1092,7 @@ if (engPutVariable(m_pEngine, "copyInputWEMToMatlab", m_X) == 0) { engEvalString(m_pEngine, "eval(copyInputWEMToMatlab); clear copyInputWEMToMatlab;"); } + mxDestroyArray(m_X); } // Put WEM into matlab structure. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bar...@us...> - 2010-08-10 13:12:24
|
Revision: 316 http://mevislabmodules.svn.sourceforge.net/mevislabmodules/?rev=316&view=rev Author: bartdedobbelaer Date: 2010-08-10 13:12:18 +0000 (Tue, 10 Aug 2010) Log Message: ----------- - Bug fix: should be face normal instead of node normal - Faster copying of WEM structure to matlab Modified Paths: -------------- trunk/Community/General/Sources/ML/MLMatlabScriptWrapper/mlMatlabScriptWrapper.cpp Modified: trunk/Community/General/Sources/ML/MLMatlabScriptWrapper/mlMatlabScriptWrapper.cpp =================================================================== --- trunk/Community/General/Sources/ML/MLMatlabScriptWrapper/mlMatlabScriptWrapper.cpp 2010-08-09 15:34:48 UTC (rev 315) +++ trunk/Community/General/Sources/ML/MLMatlabScriptWrapper/mlMatlabScriptWrapper.cpp 2010-08-10 13:12:18 UTC (rev 316) @@ -1054,7 +1054,7 @@ } } - normal = node->getNormal(); + normal = face->getNormal(); setNormals << std::dec << normal[0] << "," << std::dec << normal[1] << "," << std::dec << normal[2] << ";"; } @@ -1076,11 +1076,29 @@ setNormals << "]"; setLUT << "]"; + std::ostringstream all; + all << setNodes.str() << "\n" << setFaces.str() << "\n" << setNormals.str() << "\n" << setLUT.str() << "\n"; + + mwSize mw_dims = mwSize(2); + mwSize* mw_sz = new mwSize[2]; + mw_sz[0] = all.str().length()+1; + mw_sz[1] = 1; + + mxArray * m_X = mxCreateCharArray(mw_dims,mw_sz); + delete mw_sz; + + if (m_X) { + memcpy( mxGetData( m_X ),(void*)(all.str().c_str()), all.str().length()+1); + if (engPutVariable(m_pEngine, "copyInputWEMToMatlab", m_X) == 0) { + engEvalString(m_pEngine, "eval(copyInputWEMToMatlab); clear copyInputWEMToMatlab;"); + } + } + // Put WEM into matlab structure. - engEvalString(m_pEngine, setNodes.str().c_str()); - engEvalString(m_pEngine, setFaces.str().c_str()); - engEvalString(m_pEngine, setNormals.str().c_str()); - engEvalString(m_pEngine, setLUT.str().c_str()); + //engEvalString(m_pEngine, setNodes.str().c_str()); std::cout << "nodes" << std::endl; + //engEvalString(m_pEngine, setFaces.str().c_str()); std::cout << "faces" << std::endl; + //engEvalString(m_pEngine, setNormals.str().c_str()); std::cout << "normals" << std::endl; + //engEvalString(m_pEngine, setLUT.str().c_str()); std::cout << "lut" << std::endl; } //! Gets structure from Matlab and copies results into output WEM. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wol...@us...> - 2010-08-09 15:34:58
|
Revision: 315 http://mevislabmodules.svn.sourceforge.net/mevislabmodules/?rev=315&view=rev Author: wolfspindler Date: 2010-08-09 15:34:48 +0000 (Mon, 09 Aug 2010) Log Message: ----------- -Missing project dependency to Dcmtk dicom toolkit added. Former version did not find all dependent libraries on all platforms. Modified Paths: -------------- trunk/Community/General/Sources/ML/MLCSOToRTStructure/MLCSOToRTStructure.pro Modified: trunk/Community/General/Sources/ML/MLCSOToRTStructure/MLCSOToRTStructure.pro =================================================================== --- trunk/Community/General/Sources/ML/MLCSOToRTStructure/MLCSOToRTStructure.pro 2010-08-09 15:10:22 UTC (rev 314) +++ trunk/Community/General/Sources/ML/MLCSOToRTStructure/MLCSOToRTStructure.pro 2010-08-09 15:34:48 UTC (rev 315) @@ -17,7 +17,7 @@ WARN = HIGH # add used projects here (see included pri files below for available projects) -CONFIG += dll ML MLCSO MLDicomTree_OFFIS MLDicomTreeImagePropertyExtension boost_filesystem +CONFIG += dll ML MLCSO MLDicomTree_OFFIS MLDicomTreeImagePropertyExtension boost_filesystem dcmtk MLAB_PACKAGES += MeVisLab_Standard This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wol...@us...> - 2010-08-09 15:10:28
|
Revision: 314 http://mevislabmodules.svn.sourceforge.net/mevislabmodules/?rev=314&view=rev Author: wolfspindler Date: 2010-08-09 15:10:22 +0000 (Mon, 09 Aug 2010) Log Message: ----------- Adding further backward compatibility code to MeVisLab2.0 Modified Paths: -------------- trunk/Community/General/Sources/ML/MLCMCoordinate/BoxArithmetic/mlBoxArithmetic.cpp Modified: trunk/Community/General/Sources/ML/MLCMCoordinate/BoxArithmetic/mlBoxArithmetic.cpp =================================================================== --- trunk/Community/General/Sources/ML/MLCMCoordinate/BoxArithmetic/mlBoxArithmetic.cpp 2010-08-09 15:07:09 UTC (rev 313) +++ trunk/Community/General/Sources/ML/MLCMCoordinate/BoxArithmetic/mlBoxArithmetic.cpp 2010-08-09 15:10:22 UTC (rev 314) @@ -237,8 +237,16 @@ if ( f_V2WInput0->getBoolValue() ){ PagedImg *inImage0 = getNonDummyUpdatedInImg( 0 ); if ( inImage0 ){ + #if ML_MAJOR_VERSION >= 2 + // MeVisLab version >= MeVisLab2.1. const vec3 v1 = inImage0->mapVoxelToWorld(vec3(box0.v1[0],box0.v1[1],box0.v1[2])); const vec3 v2 = inImage0->mapVoxelToWorld(vec3(box0.v2[0],box0.v2[1],box0.v2[2])); + #else + // Old MeVisLab version < MeVisLab 2.1. + vec3 v1, v2; + inImage0->transformToWorldCoord(vec3(box0.v1[0],box0.v1[1],box0.v1[2]), v1); + inImage0->transformToWorldCoord(vec3(box0.v2[0],box0.v2[1],box0.v2[2]), v2); + #endif box0.v1[0] = v1[0]; box0.v1[1] = v1[1]; box0.v1[2] = v1[2]; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wol...@us...> - 2010-08-09 15:07:15
|
Revision: 313 http://mevislabmodules.svn.sourceforge.net/mevislabmodules/?rev=313&view=rev Author: wolfspindler Date: 2010-08-09 15:07:09 +0000 (Mon, 09 Aug 2010) Log Message: ----------- -Removed unused code to maintain forward compatibility to MeVisLab2.1. -Removed unused calcInSubImageBox code. Modified Paths: -------------- trunk/UMD/METK/Sources/ML/METK2DLabeling/mlMETK2DLabeling.cpp trunk/UMD/METK/Sources/ML/METK2DLabeling/mlMETK2DLabeling.h Modified: trunk/UMD/METK/Sources/ML/METK2DLabeling/mlMETK2DLabeling.cpp =================================================================== --- trunk/UMD/METK/Sources/ML/METK2DLabeling/mlMETK2DLabeling.cpp 2010-08-09 15:03:39 UTC (rev 312) +++ trunk/UMD/METK/Sources/ML/METK2DLabeling/mlMETK2DLabeling.cpp 2010-08-09 15:07:09 UTC (rev 313) @@ -327,29 +327,6 @@ } //---------------------------------------------------------------------------------- -//! Returns the input image region required to calculate a region of an output image. -//---------------------------------------------------------------------------------- -SubImgBox METK2DLabeling::calcInSubImageBox (int /*inIndex*/, const SubImgBox &outSubImgBox, int /*outIndex*/) -{ - ML_TRACE_IN("METK2DLabeling::calcInSubImageBox ()"); - - // Return region of input image inIndex needed to compute region - // outSubImgBox of output image outIndex. - return outSubImgBox; -} - -//---------------------------------------------------------------------------------- -//! Called to determine properties props of input image region (tile) of input inIndex -//! required to calculate an output image region (page) of output outIndex. -//---------------------------------------------------------------------------------- -void METK2DLabeling::calcInSubImageProps(int /*inIndex*/, - InSubImageProps& /*props*/, - int /*outIndex*/) -{ - ML_TRACE_IN("METK2DLabeling::calcInSubImageProps ()"); -} - -//---------------------------------------------------------------------------------- //! Calls correctly typed (template) version of calcOutSubImage to calculate page //! outSubImg of output image with index outSubImg. //---------------------------------------------------------------------------------- Modified: trunk/UMD/METK/Sources/ML/METK2DLabeling/mlMETK2DLabeling.h =================================================================== --- trunk/UMD/METK/Sources/ML/METK2DLabeling/mlMETK2DLabeling.h 2010-08-09 15:03:39 UTC (rev 312) +++ trunk/UMD/METK/Sources/ML/METK2DLabeling/mlMETK2DLabeling.h 2010-08-09 15:07:09 UTC (rev 313) @@ -67,21 +67,6 @@ //! Sets properties of the output image at output outIndex. virtual void calcOutImageProps (int outIndex); - //! Returns the input image region required to calculate a region of an output image. - //! \param inIndex The input of which the regions shall be calculated. - //! \param outSubImgBox The region of the output image for which the required input region - //! shall be calculated. - //! \param outIndex The index of the output image for which the required input region - //! shall be calculated. - //! \return Region of input image needed to compute the region outSubImgBox on output outIndex. - virtual SubImgBox calcInSubImageBox (int inIndex, const SubImgBox &outSubImgBox, int outIndex); - - //! Called to determine properties props of input image region (tile) of input inIndex - //! required to calculate an output image region (page) of output outIndex. - virtual void calcInSubImageProps (int inIndex, - InSubImageProps &props, - int outIndex); - //! Calculates page outSubImg of output image with index outIndex by using inSubimgs. //! \param outSubImg The subimage of output image outIndex calculated from inSubImgs. //! \param outIndex The index of the output the subimage is calculated for. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wol...@us...> - 2010-08-09 15:03:45
|
Revision: 312 http://mevislabmodules.svn.sourceforge.net/mevislabmodules/?rev=312&view=rev Author: wolfspindler Date: 2010-08-09 15:03:39 +0000 (Mon, 09 Aug 2010) Log Message: ----------- Adding backward compatibility code to MeVisLab2.0 Modified Paths: -------------- trunk/Community/General/Sources/ML/MLCMCoordinate/BoxArithmetic/mlBoxArithmetic.cpp Modified: trunk/Community/General/Sources/ML/MLCMCoordinate/BoxArithmetic/mlBoxArithmetic.cpp =================================================================== --- trunk/Community/General/Sources/ML/MLCMCoordinate/BoxArithmetic/mlBoxArithmetic.cpp 2010-08-09 14:41:21 UTC (rev 311) +++ trunk/Community/General/Sources/ML/MLCMCoordinate/BoxArithmetic/mlBoxArithmetic.cpp 2010-08-09 15:03:39 UTC (rev 312) @@ -38,6 +38,7 @@ // Local includes #include "mlBoxArithmetic.h" +#include "mlVersion.h" ML_START_NAMESPACE @@ -215,8 +216,16 @@ if ( f_W2VInput0->getBoolValue() ){ PagedImg *inImage0 = getNonDummyUpdatedInImg( 0 ); if ( inImage0 ){ + #if ML_MAJOR_VERSION >= 2 + // MeVisLab version >= MeVisLab2.1. const vec3 v1 = inImage0->mapWorldToVoxel(vec3(box0.v1[0],box0.v1[1],box0.v1[2])); const vec3 v2 = inImage0->mapWorldToVoxel(vec3(box0.v2[0],box0.v2[1],box0.v2[2])); + #else + // Old MeVisLab version < MeVisLab 2.1. + vec3 v1, v2; + inImage0->transformToVoxelCoord(vec3(box0.v1[0],box0.v1[1],box0.v1[2]), v1); + inImage0->transformToVoxelCoord(vec3(box0.v2[0],box0.v2[1],box0.v2[2]), v2); + #endif box0.v1[0] = v1[0]; box0.v1[1] = v1[1]; box0.v1[2] = v1[2]; @@ -292,8 +301,16 @@ if ( f_W2VInput1->getBoolValue() ){ const PagedImg *inImage1 = getNonDummyUpdatedInImg( 0 ); if ( inImage1 ){ + #if ML_MAJOR_VERSION >= 2 + // MeVisLab version >= MeVisLab2.1. const vec3 v1 = inImage1->mapWorldToVoxel(vec3(box1.v1[0],box1.v1[1],box1.v1[2])); const vec3 v2 = inImage1->mapWorldToVoxel(vec3(box1.v2[0],box1.v2[1],box1.v2[2])); + #else + // Old MeVisLab version < MeVisLab 2.1. + vec3 v1, v2; + inImage1->transformToVoxelCoord(vec3(box1.v1[0],box1.v1[1],box1.v1[2]), v1); + inImage1->transformToVoxelCoord(vec3(box1.v2[0],box1.v2[1],box1.v2[2]), v2); + #endif box1.v1[0] = v1[0]; box1.v1[1] = v1[1]; box1.v1[2] = v1[2]; @@ -305,8 +322,16 @@ if ( f_V2WInput0->getBoolValue() ){ const PagedImg *inImage1 = getNonDummyUpdatedInImg( 1 ); if ( inImage1 ){ + #if ML_MAJOR_VERSION >= 2 + // MeVisLab version >= MeVisLab2.1. const vec3 v1 = inImage1->mapVoxelToWorld(vec3(box1.v1[0],box1.v1[1],box1.v1[2])); const vec3 v2 = inImage1->mapVoxelToWorld(vec3(box1.v2[0],box1.v2[1],box1.v2[2])); + #else + // Old MeVisLab version < MeVisLab 2.1. + vec3 v1, v2; + inImage1->transformToWorldCoord(vec3(box1.v1[0],box1.v1[1],box1.v1[2]), v1); + inImage1->transformToWorldCoord(vec3(box1.v2[0],box1.v2[1],box1.v2[2]), v2); + #endif box1.v1[0] = v1[0]; box1.v1[1] = v1[1]; box1.v1[2] = v1[2]; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wol...@us...> - 2010-08-09 14:41:27
|
Revision: 311 http://mevislabmodules.svn.sourceforge.net/mevislabmodules/?rev=311&view=rev Author: wolfspindler Date: 2010-08-09 14:41:21 +0000 (Mon, 09 Aug 2010) Log Message: ----------- Removed second argument to processAllPages to maintain upward compatibility to MeVisLab2.1 Modified Paths: -------------- trunk/UMD/METK/Sources/ML/UMDCodedSegmentation/mlCalcCodedSegmentation.cpp Modified: trunk/UMD/METK/Sources/ML/UMDCodedSegmentation/mlCalcCodedSegmentation.cpp =================================================================== --- trunk/UMD/METK/Sources/ML/UMDCodedSegmentation/mlCalcCodedSegmentation.cpp 2010-08-09 14:28:17 UTC (rev 310) +++ trunk/UMD/METK/Sources/ML/UMDCodedSegmentation/mlCalcCodedSegmentation.cpp 2010-08-09 14:41:21 UTC (rev 311) @@ -117,7 +117,7 @@ replaceValues->resize(MAX_SIZE,0); addImage(); renewObjectValues(); - int error = processAllPages(0,-1); + int error = processAllPages(0); if (error!=0) std::cout << "processAllPages Error (add) = " << MLGetErrorCodeDescription(error) << std::endl; } else if (field == _fld_Reset) @@ -128,7 +128,7 @@ clearOutputImage(); getOutImg(0)->setOutOfDate(); - int error = processAllPages(0,-1); + int error = processAllPages(0); if (error!=0) std::cout << "processAllPages Error (reset) = " << MLGetErrorCodeDescription(error) << std::endl; //Das mit dem invalidieren per setOutOfDate geht nicht _fld_ObjectValues->setStringValue(""); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wol...@us...> - 2010-08-09 14:28:23
|
Revision: 310 http://mevislabmodules.svn.sourceforge.net/mevislabmodules/?rev=310&view=rev Author: wolfspindler Date: 2010-08-09 14:28:17 +0000 (Mon, 09 Aug 2010) Log Message: ----------- Removed second (default) argument to processAllPages to maintain upward compatibility to MeVisLab2.1 Modified Paths: -------------- trunk/UMD/METK/Sources/ML/Viewpoint/METKCreateIntraOPDummy/mlMETKCreateIntraOPDummy.cpp Modified: trunk/UMD/METK/Sources/ML/Viewpoint/METKCreateIntraOPDummy/mlMETKCreateIntraOPDummy.cpp =================================================================== --- trunk/UMD/METK/Sources/ML/Viewpoint/METKCreateIntraOPDummy/mlMETKCreateIntraOPDummy.cpp 2010-08-09 13:59:48 UTC (rev 309) +++ trunk/UMD/METK/Sources/ML/Viewpoint/METKCreateIntraOPDummy/mlMETKCreateIntraOPDummy.cpp 2010-08-09 14:28:17 UTC (rev 310) @@ -71,7 +71,7 @@ usedValues = ";"; isCalculating = true; voxelsPerValue.getTable()->clear(); - processAllPages(-1,0); + processAllPages(-1); std::cout << usedValues << std::endl; createMETKObjects(); isCalculating = false; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wol...@us...> - 2010-08-09 13:59:54
|
Revision: 309 http://mevislabmodules.svn.sourceforge.net/mevislabmodules/?rev=309&view=rev Author: wolfspindler Date: 2010-08-09 13:59:48 +0000 (Mon, 09 Aug 2010) Log Message: ----------- Removed second (default) argument to processAllPages to maintain upward compatibility to MeVisLab2.1 Modified Paths: -------------- trunk/Community/General/Sources/ML/CVLSegmentationEvaluationMetric/mlSegmentationEvaluationMetric.cpp Modified: trunk/Community/General/Sources/ML/CVLSegmentationEvaluationMetric/mlSegmentationEvaluationMetric.cpp =================================================================== --- trunk/Community/General/Sources/ML/CVLSegmentationEvaluationMetric/mlSegmentationEvaluationMetric.cpp 2010-08-09 13:31:00 UTC (rev 308) +++ trunk/Community/General/Sources/ML/CVLSegmentationEvaluationMetric/mlSegmentationEvaluationMetric.cpp 2010-08-09 13:59:48 UTC (rev 309) @@ -227,7 +227,7 @@ // process all pages - MLErrorCode err = processAllPages(-1,0); + MLErrorCode err = processAllPages(-1); if (err==ML_RESULT_OK) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wol...@us...> - 2010-08-09 13:31:06
|
Revision: 308 http://mevislabmodules.svn.sourceforge.net/mevislabmodules/?rev=308&view=rev Author: wolfspindler Date: 2010-08-09 13:31:00 +0000 (Mon, 09 Aug 2010) Log Message: ----------- Replaced some new style Vector3 to old named once to maintain backward compatibility to MeVisLab2.0 builds. Modified Paths: -------------- trunk/Community/General/Sources/ML/MLCMCoordinate/BoxArithmetic/mlBoxArithmetic.cpp Modified: trunk/Community/General/Sources/ML/MLCMCoordinate/BoxArithmetic/mlBoxArithmetic.cpp =================================================================== --- trunk/Community/General/Sources/ML/MLCMCoordinate/BoxArithmetic/mlBoxArithmetic.cpp 2010-08-09 13:07:04 UTC (rev 307) +++ trunk/Community/General/Sources/ML/MLCMCoordinate/BoxArithmetic/mlBoxArithmetic.cpp 2010-08-09 13:31:00 UTC (rev 308) @@ -215,8 +215,8 @@ if ( f_W2VInput0->getBoolValue() ){ PagedImg *inImage0 = getNonDummyUpdatedInImg( 0 ); if ( inImage0 ){ - const Vector3 v1 = inImage0->mapWorldToVoxel(Vector3(box0.v1[0],box0.v1[1],box0.v1[2])); - const Vector3 v2 = inImage0->mapWorldToVoxel(Vector3(box0.v2[0],box0.v2[1],box0.v2[2])); + const vec3 v1 = inImage0->mapWorldToVoxel(vec3(box0.v1[0],box0.v1[1],box0.v1[2])); + const vec3 v2 = inImage0->mapWorldToVoxel(vec3(box0.v2[0],box0.v2[1],box0.v2[2])); box0.v1[0] = v1[0]; box0.v1[1] = v1[1]; box0.v1[2] = v1[2]; @@ -228,8 +228,8 @@ if ( f_V2WInput0->getBoolValue() ){ PagedImg *inImage0 = getNonDummyUpdatedInImg( 0 ); if ( inImage0 ){ - const Vector3 v1 = inImage0->mapVoxelToWorld(Vector3(box0.v1[0],box0.v1[1],box0.v1[2])); - const Vector3 v2 = inImage0->mapVoxelToWorld(Vector3(box0.v2[0],box0.v2[1],box0.v2[2])); + const vec3 v1 = inImage0->mapVoxelToWorld(vec3(box0.v1[0],box0.v1[1],box0.v1[2])); + const vec3 v2 = inImage0->mapVoxelToWorld(vec3(box0.v2[0],box0.v2[1],box0.v2[2])); box0.v1[0] = v1[0]; box0.v1[1] = v1[1]; box0.v1[2] = v1[2]; @@ -292,8 +292,8 @@ if ( f_W2VInput1->getBoolValue() ){ const PagedImg *inImage1 = getNonDummyUpdatedInImg( 0 ); if ( inImage1 ){ - const Vector3 v1 = inImage1->mapWorldToVoxel(Vector3(box1.v1[0],box1.v1[1],box1.v1[2])); - const Vector3 v2 = inImage1->mapWorldToVoxel(Vector3(box1.v2[0],box1.v2[1],box1.v2[2])); + const vec3 v1 = inImage1->mapWorldToVoxel(vec3(box1.v1[0],box1.v1[1],box1.v1[2])); + const vec3 v2 = inImage1->mapWorldToVoxel(vec3(box1.v2[0],box1.v2[1],box1.v2[2])); box1.v1[0] = v1[0]; box1.v1[1] = v1[1]; box1.v1[2] = v1[2]; @@ -305,8 +305,8 @@ if ( f_V2WInput0->getBoolValue() ){ const PagedImg *inImage1 = getNonDummyUpdatedInImg( 1 ); if ( inImage1 ){ - const Vector3 v1 = inImage1->mapVoxelToWorld(Vector3(box1.v1[0],box1.v1[1],box1.v1[2])); - const Vector3 v2 = inImage1->mapVoxelToWorld(Vector3(box1.v2[0],box1.v2[1],box1.v2[2])); + const vec3 v1 = inImage1->mapVoxelToWorld(vec3(box1.v1[0],box1.v1[1],box1.v1[2])); + const vec3 v2 = inImage1->mapVoxelToWorld(vec3(box1.v2[0],box1.v2[1],box1.v2[2])); box1.v1[0] = v1[0]; box1.v1[1] = v1[1]; box1.v1[2] = v1[2]; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wol...@us...> - 2010-08-09 13:07:10
|
Revision: 307 http://mevislabmodules.svn.sourceforge.net/mevislabmodules/?rev=307&view=rev Author: wolfspindler Date: 2010-08-09 13:07:04 +0000 (Mon, 09 Aug 2010) Log Message: ----------- Typo fixed. Modified Paths: -------------- trunk/Community/General/Sources/ML/MLBarcode/mlBarcode.cpp Modified: trunk/Community/General/Sources/ML/MLBarcode/mlBarcode.cpp =================================================================== --- trunk/Community/General/Sources/ML/MLBarcode/mlBarcode.cpp 2010-08-09 12:20:30 UTC (rev 306) +++ trunk/Community/General/Sources/ML/MLBarcode/mlBarcode.cpp 2010-08-09 13:07:04 UTC (rev 307) @@ -506,7 +506,7 @@ TSubImgCursor<DATATYPE> outSubImage(*outImg); #else // < MeVisLab 2.1 - TSubImg<DATATYE> &outSubImage = *outImg; + TSubImg<DATATYPE> &outSubImage = *outImg; #endif if (_codeline==NULL) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wol...@us...> - 2010-08-09 12:20:36
|
Revision: 306 http://mevislabmodules.svn.sourceforge.net/mevislabmodules/?rev=306&view=rev Author: wolfspindler Date: 2010-08-09 12:20:30 +0000 (Mon, 09 Aug 2010) Log Message: ----------- MeVisLab2.0 -> MeVisLab2.1 compatibility fix applied. Modified Paths: -------------- trunk/Community/General/Sources/ML/MLBarcode/mlBarcode.cpp Modified: trunk/Community/General/Sources/ML/MLBarcode/mlBarcode.cpp =================================================================== --- trunk/Community/General/Sources/ML/MLBarcode/mlBarcode.cpp 2010-08-09 07:09:22 UTC (rev 305) +++ trunk/Community/General/Sources/ML/MLBarcode/mlBarcode.cpp 2010-08-09 12:20:30 UTC (rev 306) @@ -36,6 +36,7 @@ // Include your header. #include "mlBarcode.h" +#include "mlVersion.h" ML_START_NAMESPACE @@ -498,9 +499,16 @@ // Output image (barcode) is rotated for better use in mammogramms! Vector dim = outImg->getImgExt(); - SubImgBox loc = outImg->getBox(); DATATYPE temp_pixelvalue=0; + #if ML_MAJOR_VERSION >= 2 + // >= MeVisLab 2.1 + TSubImgCursor<DATATYPE> outSubImage(*outImg); + #else + // < MeVisLab 2.1 + TSubImg<DATATYE> &outSubImage = *outImg; + #endif + if (_codeline==NULL) { makeCodeLine(); } @@ -512,10 +520,10 @@ v.y=0; temp_pixelvalue = (DATATYPE) (_codeline[v.x]); - outImg->setCursorSubImgPos(v); + outSubImage.setCursorSubImgPos(v); for (v.y=0; v.y<dim.y; v.y++) { - *(outImg->getCursorPos()) = temp_pixelvalue; - outImg->moveCursorY(); + *(outSubImage.getCursorPos()) = temp_pixelvalue; + outSubImage.moveCursorY(); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bar...@us...> - 2010-08-09 07:09:28
|
Revision: 305 http://mevislabmodules.svn.sourceforge.net/mevislabmodules/?rev=305&view=rev Author: bartdedobbelaer Date: 2010-08-09 07:09:22 +0000 (Mon, 09 Aug 2010) Log Message: ----------- - Added export of LUT for WEMs Modified Paths: -------------- trunk/Community/General/Sources/ML/MLMatlabScriptWrapper/mlMatlabScriptWrapper.cpp Modified: trunk/Community/General/Sources/ML/MLMatlabScriptWrapper/mlMatlabScriptWrapper.cpp =================================================================== --- trunk/Community/General/Sources/ML/MLMatlabScriptWrapper/mlMatlabScriptWrapper.cpp 2010-08-08 09:24:57 UTC (rev 304) +++ trunk/Community/General/Sources/ML/MLMatlabScriptWrapper/mlMatlabScriptWrapper.cpp 2010-08-09 07:09:22 UTC (rev 305) @@ -1009,10 +1009,11 @@ std::string inWEMStr = _inWEMNameFld->getStringValue(); // Strings to evaluate. - std::ostringstream setNodes, setFaces, setNormals; + std::ostringstream setNodes, setFaces, setNormals, setLUT; setNodes << inWEMStr.c_str() << "{1}.Vertices=["; setFaces << inWEMStr.c_str() << "{1}.Faces=["; setNormals << inWEMStr.c_str() << "{1}.VertexNormals=["; + setLUT << inWEMStr.c_str() << "{1}.LUT=["; // Loop over all patches -> flatten WEM for (i = 0; i < inputWEM->getNumWEMPatches(); i ++) { @@ -1057,17 +1058,29 @@ setNormals << std::dec << normal[0] << "," << std::dec << normal[1] << "," << std::dec << normal[2] << ";"; } + // Get LUT primitive value list + WEMPrimitiveValueList *pvl = NULL; + pvl = patch->getPrimitiveValueList("LUT"); + if (pvl->isValid()) { + const unsigned int numValues = pvl->getNumValues(); + for (j = 0; j < numValues; j ++) { + setLUT << pvl->getValue(j) << ";"; + } + } + totalNumNodes += numNodes + numTriangulatedNodes; } setNodes << "]"; setFaces << "]+1"; setNormals << "]"; + setLUT << "]"; // Put WEM into matlab structure. engEvalString(m_pEngine, setNodes.str().c_str()); engEvalString(m_pEngine, setFaces.str().c_str()); engEvalString(m_pEngine, setNormals.str().c_str()); + engEvalString(m_pEngine, setLUT.str().c_str()); } //! Gets structure from Matlab and copies results into output WEM. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |