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-03-05 11:27:00
|
Revision: 229 http://mevislabmodules.svn.sourceforge.net/mevislabmodules/?rev=229&view=rev Author: coertmetz Date: 2010-03-05 11:26:53 +0000 (Fri, 05 Mar 2010) Log Message: ----------- CM: Added 4 XMarkerListModules: - TransformXMarkerList: transform XMarker coordinates using a transformation matrix (or a matrix composed from elementary transforms. - LinearInterpolateXMarkerList: equidistantly linearly interpolate XMarker coordinates. - XMarkerListFromFile: load an XMarkerList from a text file. - XMarkerListToFile: save an XMarkerList as a text file. Added Paths: ----------- trunk/Community/General/Modules/ML/MLXMarkerListCommunityModules/ trunk/Community/General/Modules/ML/MLXMarkerListCommunityModules/EMCTransformXMarkerList.script trunk/Community/General/Modules/ML/MLXMarkerListCommunityModules/MLXMarkerListCommunityModules.def trunk/Community/General/Modules/ML/MLXMarkerListCommunityModules/html/ trunk/Community/General/Modules/ML/MLXMarkerListCommunityModules/html/LinearInterpolateXMarkerList.html trunk/Community/General/Modules/ML/MLXMarkerListCommunityModules/html/TransformXMarkerList.html trunk/Community/General/Modules/ML/MLXMarkerListCommunityModules/html/XMarkerListFromFile.html trunk/Community/General/Modules/ML/MLXMarkerListCommunityModules/html/XMarkerListToFile.html trunk/Community/General/Modules/ML/MLXMarkerListCommunityModules/networks/ trunk/Community/General/Modules/ML/MLXMarkerListCommunityModules/networks/LinearInterpolateXMarkerListExample.mlab trunk/Community/General/Modules/ML/MLXMarkerListCommunityModules/networks/TransformXMarkerList.mlab Added: trunk/Community/General/Modules/ML/MLXMarkerListCommunityModules/EMCTransformXMarkerList.script =================================================================== --- trunk/Community/General/Modules/ML/MLXMarkerListCommunityModules/EMCTransformXMarkerList.script (rev 0) +++ trunk/Community/General/Modules/ML/MLXMarkerListCommunityModules/EMCTransformXMarkerList.script 2010-03-05 11:26:53 UTC (rev 229) @@ -0,0 +1,68 @@ +/* ================================================================================= + Copyright (c) 2010, Biomedical Imaging Group Rotterdam (BIGR), + Departments of Radiology and Medical Informatics, Erasmus MC. All + rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of BIGR nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL BIGR BE LIABLE FOR ANY DIRECT, INDIRECT, + INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, + OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE + OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + =================================================================================*/ + +Window { + mw = 400 + Vertical { + margin = 3 + Field transformEnabled {} + Box "Transformation matrix" { + TextView matrix { autoApply = true } + } + CheckBox useElementaryTransforms { } + Box "Elementary Transforms" { + dependsOn = useElementaryTransforms + layout = Vertical + Field center { + title = "Center for Scaling/Rotation" + } + Field scaleOrientation { + title = "Scale Orientation" + applyButton = false + } + Field scale { + title = "Scale" + } + Field rotation { + title = Rotation + applyButton = false + } + Field translation { + title = Translation + } + } // Box "Elementary Transforms" + CheckBox divideByHomogeneousCoordinate {} + } +} + +//# MeVis signature v1 +//# key: MFowDQYJKoZIhvcNAQEBBQADSQAwRgJBAIxReSJcHI34sXEB0NqLoJHWaWV7XwJnnI+Y02umLV+yAHmXeUVJa8k1rq2ttPmun7l5CPC22hQmv+UQfvCdQFECARE=:VWI0zSBB707mij5DQNRIokfXszozI6YpwfSE2swoufEhDA+r6kELRyeapKMzLslRYNNJ7oRpWAKBxOE/Xutp9A== +//# owner: EMC +//# date: 2010-03-04T17:29:35 +//# hash: GzV5rTM2HhUQwcZVwL3xWlNgcgTq/254bZp6f8gA6XGsjOeA+QsEisbyMNC3kiLfUieWQhECvqoGbbxdIxKShQ== +//# MeVis end Property changes on: trunk/Community/General/Modules/ML/MLXMarkerListCommunityModules/EMCTransformXMarkerList.script ___________________________________________________________________ Added: svn:keywords + " Date Revision Author HeadURL Id " Added: svn:eol-style + native Added: trunk/Community/General/Modules/ML/MLXMarkerListCommunityModules/MLXMarkerListCommunityModules.def =================================================================== --- trunk/Community/General/Modules/ML/MLXMarkerListCommunityModules/MLXMarkerListCommunityModules.def (rev 0) +++ trunk/Community/General/Modules/ML/MLXMarkerListCommunityModules/MLXMarkerListCommunityModules.def 2010-03-05 11:26:53 UTC (rev 229) @@ -0,0 +1,132 @@ +//---------------------------------------------------------------------------------- +//! MLXMarkerListCommunityModules module definitions. +/*! +// \file MLXMarkerListCommunityModules.def +// \author Coert Metz +// \date 2010-03-05 +*/ +//---------------------------------------------------------------------------------- + + +//---------------------------------------------------------------------------------- +// MLModule LinearInterpolateXMarkerList +//---------------------------------------------------------------------------------- +MLModule LinearInterpolateXMarkerList { + DLL = "MLXMarkerListCommunityModules" + + genre = "BIGR-XMarkerList" + group = "BIGR" + author = "Coert Metz" + status = "stable" + comment = "Linearly interpolate an XMarkerList" + keywords = "XMarkerList Linear Interpolate Interpolation" + seeAlso = "ResampleAndSmoothXMarkerList" + documentation = "$(LOCAL)/html/LinearInterpolateXMarkerList.html" + exampleNetwork = "$(LOCAL)/networks/LinearInterpolateXMarkerListExample.mlab" + + Window { + Vertical { + margin = 3 + Field sampleDistance { + tooltip = "" + } + } + } +} // MLModule LinearInterpolateXMarkerList + +//---------------------------------------------------------------------------------- +// MLModule XMarkerListFromFile +//---------------------------------------------------------------------------------- +MLModule XMarkerListFromFile { + DLL = "MLXMarkerListCommunityModules" + + genre = "BIGR-XMarkerList" + group = "BIGR" + author = "Coert Metz" + status = "stable" + comment = "Read XMarkerList from a text file" + keywords = "XMarkerList XMarker file text load read import" + seeAlso = "XMarkerListToFile" + documentation = "$(LOCAL)/html/XMarkerListFromFile.html" + + Window { + mw=600 + Vertical { + margin=3 + Field filename { browseButton = true browseFilter = "Text files (*.txt);;All files (*.*)"} + Field importPositionX {} + Field importPositionY {} + Field importPositionZ {} + Field importPositionT {} + Field importVectorX {} + Field importVectorY {} + Field importVectorZ {} + Field importType { alignGroup=left } + Field numElementsToSkip {} + Field inputCoordinateSystem {} + Separator {} + Horizontal { + alignX = Left + Button update {} + Field autoUpdate {} + } + } + } +} // MLModule XMarkerListFromFile + +//---------------------------------------------------------------------------------- +// MLModule XMarkerListFromFile +//---------------------------------------------------------------------------------- +MLModule XMarkerListToFile { + DLL = "MLXMarkerListCommunityModules" + + genre = "BIGR-XMarkerList" + group = "BIGR" + author = "Coert Metz" + status = "stable" + comment = "Save XMarkerList to a text file" + keywords = "XMarkerList XMarker file text save store export" + seeAlso = "XMarkerListFromFile" + documentation = "$(LOCAL)/html/XMarkerListToFile.html" + + Window { + mw=600 + Vertical { + margin=3 + Field filename { alignGroup=left browseButton = true browseMode = save browseFilter = "Text files (*.txt);;All files (*.*)"} + Field exportPositionX {} + Field exportPositionY {} + Field exportPositionZ {} + Field exportPositionT {} + Field exportVectorX {} + Field exportVectorY {} + Field exportVectorZ {} + Field exportType { alignGroup=left } + Field coordinateSeparator { alignGroup=left } + Field outputCoordinateSystem { alignGroup=left } + Field elastixFormat { alignGroup = Left } + Field maxOneMarkerPerVoxel {} + Separator {} + Button save { } + } + } +} // MLModule XMarkerListFromFile + +//---------------------------------------------------------------------------- +// MLModule TransformXMarkerList +//---------------------------------------------------------------------------- +MLModule TransformXMarkerList { + DLL = "MLXMarkerListCommunityModules" + + genre = "BIGR-XMarkerList" + group = "BIGR" + author = "Coert Metz" + status = "stable" + comment = "Transform all XMarkers of an XMarkerList with the given matrix or elementary transforms" + keywords = "xmarker xmarkerlist transform translate rotate rotation translation scale scaling" + seeAlso = "" + documentation = "$(LOCAL)/html/TransformXMarkerList.html" + exampleNetwork = "$(LOCAL)/networks/TransformXMarkerList.mlab" + externalDefinition = "$(LOCAL)/EMCTransformXMarkerList.script" + +} // MLModule TransformXMarkerList \ No newline at end of file Property changes on: trunk/Community/General/Modules/ML/MLXMarkerListCommunityModules/MLXMarkerListCommunityModules.def ___________________________________________________________________ Added: svn:keywords + " Date Revision Author HeadURL Id " Added: svn:eol-style + native Added: trunk/Community/General/Modules/ML/MLXMarkerListCommunityModules/html/LinearInterpolateXMarkerList.html =================================================================== --- trunk/Community/General/Modules/ML/MLXMarkerListCommunityModules/html/LinearInterpolateXMarkerList.html (rev 0) +++ trunk/Community/General/Modules/ML/MLXMarkerListCommunityModules/html/LinearInterpolateXMarkerList.html 2010-03-05 11:26:53 UTC (rev 229) @@ -0,0 +1,69 @@ +<!doctype html public "-//w3c//dtd html 4.0 transitional//en"> +<html> +<head> + <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> + <meta name="GENERATOR" content="Mozilla/4.78 [en] (Windows NT 5.0; U) [Netscape]"> + <meta name="Description" content="MeVisLab module help page template"> + <title>Module Help Page</title> +</head> +<body> + +<center><a href="#Purpose">Purpose</a> <a href="#Usage">Usage</a> <a href="#Details">Details</a> <a href="#InputFields">Input</a> <a href="#OutputFields">Output</a> <a href="#Parameters">Parameters</a> + <a href="#Example">Example</a> +<hr WIDTH="100%"></center> +<h2>LinearInterpolateXMarkerList</h2> + +<h3><a NAME=Purpose></a>Purpose</h3> +<blockquote>Linearly interpolates an XMarkerList. Markers are interpolated between the input markers using the provided sample distance. +</blockquote> + +<h3><a NAME=Usage></a>Usage</h3> +<blockquote>Connect an XMarkerList and provide a sample distance in the GUI. +</blockquote> + +<h3><a NAME=Details></a>Details</h3> +<blockquote>Note that the input markers are not perse part of the output XMarkerList as the distance between the input markers is not always a multitude of the sample distance. +</blockquote> + +<h3><a NAME="InputFields"></a>Input</h3> +<blockquote> <ul> + <li> + <b>inputXMarkerList</b> + Input markers + </li> + </ul> + +</blockquote> + +<h3><a NAME="OutputFields"></a>Output</h3> +<blockquote> <ul> + <li> + <b>outputXMarkerList</b> + Equidistantly linearly interpolated XMarkers + </li> + </ul> + +</blockquote> + +<h3><a NAME="Parameters"></a>Parameters</h3> +<blockquote> <ul> + <li> + <b>sampleDistance</b> + XMarker sample distance in mm. Markers are equidistantly linearly interpolated between the input makers using this distance. + </li> + </ul> + +</blockquote> + + + +<h3><a NAME=Example></a>Example</h3> +<blockquote>See example network. +</blockquote> + + + + + +</body> +</html> Property changes on: trunk/Community/General/Modules/ML/MLXMarkerListCommunityModules/html/LinearInterpolateXMarkerList.html ___________________________________________________________________ Added: svn:keywords + " Date Revision Author HeadURL Id " Added: svn:eol-style + native Added: trunk/Community/General/Modules/ML/MLXMarkerListCommunityModules/html/TransformXMarkerList.html =================================================================== --- trunk/Community/General/Modules/ML/MLXMarkerListCommunityModules/html/TransformXMarkerList.html (rev 0) +++ trunk/Community/General/Modules/ML/MLXMarkerListCommunityModules/html/TransformXMarkerList.html 2010-03-05 11:26:53 UTC (rev 229) @@ -0,0 +1,83 @@ +<!DOCTYPE html PUBLIC "-//w3c//dtd html 4.0 transitional//en"> +<html> + <head> + <meta http-equiv="Content-Type" + content="text/html; charset=iso-8859-1"> + <meta name="GENERATOR" content="Microsoft FrontPage 4.0"> + <meta name="Description" content="XMarkerListToContour module help file"> + <title>MevisLab TransformXMarkerList</title> + </head> + <body> + <center><a href="#Purpose">Purpose</a> <a href="#Usage">Usage</a> <a + href="#Details">Details</a> <a href="#Inputs">Inputs</a> <a + href="#Outputs">Outputs</a> <a href="#Parameters">Parameters</a> <a + href="#Example">Example</a> <a href="#Tips&Tricks">Tips&Tricks</a> <a + href="#KnownBugs">Known Bugs</a> + <hr width="100%"></center> + + <h2>TransformXMarkerList</h2> + + <h3> <a name="Purpose"></a>Purpose</h3> + + <blockquote> + <b>TransformXMarkerList</b> transforms the XMarkers in the input + XMarkerList with the given transformation matrix or with the + transformation matrix composed of the given elementary transforms. + </blockquote> + + <h3> <a name="Usage"></a>Usage</h3> + + <blockquote> + <p>Connect an XMarkerList to the input, enter some elementary transforms + or fill in your own transformation matrix. The output connector delivers an XMarkerList + containing the transformed XMarkers. + </blockquote> + + <h3> <a name="Details"></a>Details</h3> + + <blockquote> + <p>If 'use elementary transforms' is checked the module first composes + the transformation matrix. If not checked the given transformation matrix + will be used directly. Elementary transforms will be applied in the same order as implemented by the + SetWorldMatrix module. After the transformation matrix is composed, the + module transforms all XMarkers in the input XMarkerList with the transformation + matrix. + </blockquote> + + <h3> <a name="Inputs"></a>Inputs</h3> + + <ul> + <li><b>Input XMarkerList</b><br>The XMarkerList containing the XMarkers to be transformed.</li> + </ul> + + <h3> <a name="Outputs"></a>Outputs</h3> + + <ul> + <li><b>Output XMarkerList:</b><br>The XMarkerList containing the transformed XMarkers. + </li> + </ul> + + <h3> <a name="Parameters"></a>Parameters</h3> + + <ul> + <li><b>Matrix</b><br>The transformation matrix</li> + <li><b>Elementary transforms</b><br>If 'use elementary transforms' is checked, + the transformation matrix will be composed of the given elementary transforms. + Elementary transforms will be applied in the same order as implemented by the + SetWorldMatrix module.</li> + <li> + <b>Divide by homogeneous coordinate</b><br>Before transformation the 4th coordinate of the marker is set to 1. If you want to divide the resulting coordinate with the value of the 4th element after the transformation, check this box. For example usefull for projective transformations. + </li></ul> + + <h3> <a name="Example"></a>Example</h3> + <blockquote>See example network.</blockquote> + + <h3> <a name="Tips&Tricks"></a>Tips & Tricks</h3> + <blockquote> + None + </blockquote> + <h3> <a name="KnownBugs"></a>Known Bugs</h3> + <blockquote> + None</blockquote> + </body> +</html> Property changes on: trunk/Community/General/Modules/ML/MLXMarkerListCommunityModules/html/TransformXMarkerList.html ___________________________________________________________________ Added: svn:keywords + " Date Revision Author HeadURL Id " Added: svn:eol-style + native Added: trunk/Community/General/Modules/ML/MLXMarkerListCommunityModules/html/XMarkerListFromFile.html =================================================================== --- trunk/Community/General/Modules/ML/MLXMarkerListCommunityModules/html/XMarkerListFromFile.html (rev 0) +++ trunk/Community/General/Modules/ML/MLXMarkerListCommunityModules/html/XMarkerListFromFile.html 2010-03-05 11:26:53 UTC (rev 229) @@ -0,0 +1,115 @@ +<!doctype html public "-//w3c//dtd html 4.0 transitional//en"> +<html> +<head> + <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> + <meta name="GENERATOR" content="Mozilla/4.78 [en] (Windows NT 5.0; U) [Netscape]"> + <meta name="Description" content="MeVisLab module help page template"> + <title>Module Help Page</title> +</head> +<body> + +<center><a href="#Purpose">Purpose</a> <a href="#Usage">Usage</a> <a href="#Details">Details</a> <a href="#InputFields">Input</a> <a href="#OutputFields">Output</a> <a href="#Parameters">Parameters</a> + +<hr WIDTH="100%"></center> +<h2>XMarkerListFromFile</h2> + +<h3><a NAME=Purpose></a>Purpose</h3> +<blockquote>Load an XMarkerList from a plain text file. +</blockquote> + +<h3><a NAME=Usage></a>Usage</h3> +<blockquote>Choose filename, select elements of the XMarkers to load, select coordinate system and press load. +</blockquote> + +<h3><a NAME=Details></a>Details</h3> +<blockquote>Elements are read in the order they are presented in the GUI. So position-x is read before position-y, etc. Random ordening of the elements in the text file is therefore not possible. When the voxel coordinate system is selected an input image need to be connected. Elements are read based on any white space separation. Other separators are not supported. +</blockquote> + +<h3><a NAME="InputFields"></a>Input</h3> +<blockquote> <ul> + <li> + <b>input0</b> + Input image needed for voxel to world matrix when the input coordinate system is set to voxel. + </li> + </ul> + +</blockquote> + +<h3><a NAME="OutputFields"></a>Output</h3> +<blockquote> <ul> + <li> + <b>outputXMarkerList</b> + The loaded XMarkerList + </li> + </ul> + +</blockquote> + +<h3><a NAME="Parameters"></a>Parameters</h3> +<blockquote> <ul> + <li> + <b>filename</b> + Filename of text file to read. + </li> + <li> + <b>importPositionX</b> + Import position x-coordinate. + </li> + <li> + <b>importPositionY</b> + Import position y-coordinate. + </li> + <li> + <b>importPositionZ</b> + Import position z-coordinate. + </li> + <li> + <b>importPositionT</b> + Import position t-coordinate. + </li> + <li> + <b>importVectorX</b> + Import vector x-coordinate. + </li> + <li> + <b>importVectorY</b> + Import vector y-coordinate. + </li> + <li> + <b>importVectorZ</b> + Import vector z-coordinate. + </li> + <li> + <b>importType</b> + Import type attribute. + </li> + <li> + <b>inputCoordinateSystem</b> + Coordinate system of input file. + </li> + <li> + <b>numElementsToSkip</b> + Number of elements to skip at beginning of file. + </li> + <li> + <b>update</b> + Start loading XMarkerList. + </li> + <li> + <b>autoUpdate</b> + Automatically load XMarkerList on any field changes. + </li> + </ul> + +</blockquote> + + + + + + + + + +</body> +</html> Property changes on: trunk/Community/General/Modules/ML/MLXMarkerListCommunityModules/html/XMarkerListFromFile.html ___________________________________________________________________ Added: svn:keywords + " Date Revision Author HeadURL Id " Added: svn:eol-style + native Added: trunk/Community/General/Modules/ML/MLXMarkerListCommunityModules/html/XMarkerListToFile.html =================================================================== --- trunk/Community/General/Modules/ML/MLXMarkerListCommunityModules/html/XMarkerListToFile.html (rev 0) +++ trunk/Community/General/Modules/ML/MLXMarkerListCommunityModules/html/XMarkerListToFile.html 2010-03-05 11:26:53 UTC (rev 229) @@ -0,0 +1,115 @@ +<!doctype html public "-//w3c//dtd html 4.0 transitional//en"> +<html> +<head> + <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> + <meta name="GENERATOR" content="Mozilla/4.78 [en] (Windows NT 5.0; U) [Netscape]"> + <meta name="Description" content="MeVisLab module help page template"> + <title>Module Help Page</title> +</head> +<body> + +<center><a href="#Purpose">Purpose</a> <a href="#Usage">Usage</a> <a href="#Details">Details</a> <a href="#InputFields">Input</a> <a href="#Parameters">Parameters</a> + +<hr WIDTH="100%"></center> +<h2>XMarkerListToFile</h2> + +<h3><a NAME=Purpose></a>Purpose</h3> +<blockquote>Exports an XMarkerList to a text file. Both world and voxel coordinate exports are supported. +</blockquote> + +<h3><a NAME=Usage></a>Usage</h3> +<blockquote>Connect an XMarkerList and an input image (when exporting voxel coordinates), select elements to export and coordinate system and press save. +</blockquote> + +<h3><a NAME=Details></a>Details</h3> +<blockquote>Elements are written to the text file in the order they appear in the GUI. It's not possible to export them using other orderings. +</blockquote> + +<h3><a NAME="InputFields"></a>Input</h3> +<blockquote> <ul> + <li> + <b>input0</b> + Input image needed to transform markers to voxel coordinates. + </li> + <li> + <b>inputXMarkerList</b> + Input XMarkerList to save. + </li> + </ul> + +</blockquote> + + + +<h3><a NAME="Parameters"></a>Parameters</h3> +<blockquote> <ul> + <li> + <b>filename</b> + Filename to save XMarkerList to + </li> + <li> + <b>outputCoordinateSystem</b> + Output coordinate system. Either world (markers are not changed), voxel (both the marker position and the marker vector are transformed to voxel coordinates before export) or pos:voxel, vec:world (only the marker position is converted to voxel coordinates before export). + </li> + <li> + <b>coordinateSeparator</b> + Separator between the elements in the text file. + </li> + <li> + <b>exportPositionX</b> + Enable/disable exporting x-coordinate of marker position. + </li> + <li> + <b>exportPositionY</b> + Enable/disable exporting y-coordinate of marker position. + </li> + <li> + <b>exportPositionZ</b> + Enable/disable exporting z-coordinate of marker position. + </li> + <li> + <b>exportPositionT</b> + Enable/disable exporting t-coordinate of marker position. + </li> + <li> + <b>exportVectorX</b> + Enable/disable exporting x-coordinate of marker vector. + </li> + <li> + <b>exportVectorY</b> + Enable/disable exporting y-coordinate of marker vector. + </li> + <li> + <b>exportVectorZ</b> + Enable/disable exporting z-coordinate of marker vector. + </li> + <li> + <b>exportType</b> + Enable/disable exporting type of marker. + </li> + <li> + <b>maxOneMarkerPerVoxel</b> + Allow only one marker per voxel in the exported list. + </li> + <li> + <b>elastixFormat</b> + Export in transformix format (1st line: point/index, 2nd line: number of points). + </li> + <li> + <b>save</b> + Start saving the XMarkerList. + </li> + </ul> + +</blockquote> + + + + + + + + + +</body> +</html> Property changes on: trunk/Community/General/Modules/ML/MLXMarkerListCommunityModules/html/XMarkerListToFile.html ___________________________________________________________________ Added: svn:keywords + " Date Revision Author HeadURL Id " Added: svn:eol-style + native Added: trunk/Community/General/Modules/ML/MLXMarkerListCommunityModules/networks/LinearInterpolateXMarkerListExample.mlab =================================================================== --- trunk/Community/General/Modules/ML/MLXMarkerListCommunityModules/networks/LinearInterpolateXMarkerListExample.mlab (rev 0) +++ trunk/Community/General/Modules/ML/MLXMarkerListCommunityModules/networks/LinearInterpolateXMarkerListExample.mlab 2010-03-05 11:26:53 UTC (rev 229) @@ -0,0 +1,339 @@ +// MDL v1 utf8 +network { + watchlist = "" +} +module ConstantImage { + internal { + frame = "-147 101 120 56" + moduleGroupName = "" + windows { + window _default { + geometry = "534 299 219 246" + sizeHint = "219 246" + wasOpen = no + wasActive = no + } + } + } + fields { + instanceName = ConstantImage + sizeX = 256 + sizeY = 256 + sizeZ = 1 + sizeC = 1 + sizeT = 1 + sizeU = 1 + dataType = float + fillValue = 0 + autoApply = TRUE + } +} +module SoGroup { + internal { + frame = "-63 -163 96 56" + moduleGroupName = "" + } + fields { + instanceName = SoGroup + } +} +module SoView2DMarkerEditor { + internal { + frame = "-27 -99 168 56" + moduleGroupName = "" + windows { + window _default { + geometry = "582 8 435 831" + sizeHint = "435 831" + wasOpen = no + wasActive = no + } + } + } + fields { + drawingOn = TRUE + editingOn = FALSE + maskValid = FALSE + fixZOn = TRUE + color = "1 1 1" + selectionTolerance = 2 + needsValidVoxel = TRUE + button1 = PRESSED + button2 = IGNORED + button3 = IGNORED + shift = IGNORED + control = IGNORED + alt = IGNORED + wantsAllEvents = FALSE + wantsKeyEvents = TRUE + wantsMouseWheelEvents = FALSE + setEventHandled = FALSE + ignoreHandledEvents = FALSE + createNewMode = FALSE + renderOnSlab = FALSE + clipToSlice = FALSE + cursorShape = UNDEFINED_CURSOR + depthVisibility = 1 + snapToVoxel = FALSE + snapToSlice = FALSE + currentType = 0 + deleteOnClick = FALSE + addOnClick = FALSE + alphaFactor = 1 + iconFile = $(MLAB_MeVisLab_Standard)/Modules/Resources/Images/markerIcons.tif + internalIconFile = "C:/Program Files/MeVisLab2.0VC9/Packages/MeVisLab/Standard/Modules/Resources/Images/markerIcons.tif" + useIconFile = FALSE + iconIdx = 0 + selectingOn = FALSE + actOnReleaseOnly = FALSE + editorMode = EDIT_MARKER + colorMode = COLOR_BY_TYPE + textColorMode = COLOR_TEXT + textMode = TEXT_OFF + textColor = "1 1 1" + textShadow = TRUE + textFontSize = 12 + showTextOnlyForSelectedMarker = FALSE + cutText = FALSE + maxNumberOfLines = 1 + vectorArrow = VECTOR_END_ARROW + useAntiAlias = FALSE + currentStyleIndex = -1 + depthVectorDrawMode = DRAW_NONE + drawMode = DRAW_MARKER + selectiveDrawing = FALSE + selectionBoxesForCurrentOnly = FALSE + cooperative = FALSE + busy = FALSE + instanceName = SoView2DMarkerEditor1 + listString = "" + numItems = 65 + index = 0 + persistent = FALSE + listStringEnable = FALSE + ownsList = FALSE + applySelect = FALSE + id = 979 + name = "" + newName = "" + actionClass = Insert + actionIndex = 64 + actionId = 1043 + currentIndex = 64 + overflowMode = None + maxSize = 0 + useInsertTemplate = FALSE + upToDate = TRUE + posXYZ = "87.5 68.5 0.5" + posC = 0 + posT = 0 + posU = 0 + vecXYZ = "0 0 0" + type = 0 + newPosXYZ = "0 0 0" + newPosC = 0 + newPosT = 0 + newPosU = 0 + newVecXYZ = "0 0 0" + newType = 0 + } +} +module SoView2DMarkerEditor { + internal { + frame = "-103 37 160 56" + moduleGroupName = "" + } + fields { + drawingOn = TRUE + editingOn = TRUE + maskValid = FALSE + fixZOn = TRUE + color = "1 1 1" + selectionTolerance = 4 + needsValidVoxel = TRUE + button1 = PRESSED + button2 = IGNORED + button3 = IGNORED + shift = IGNORED + control = IGNORED + alt = IGNORED + wantsAllEvents = FALSE + wantsKeyEvents = TRUE + wantsMouseWheelEvents = FALSE + setEventHandled = FALSE + ignoreHandledEvents = FALSE + createNewMode = FALSE + renderOnSlab = FALSE + clipToSlice = FALSE + cursorShape = UNDEFINED_CURSOR + depthVisibility = 1 + snapToVoxel = TRUE + snapToSlice = TRUE + currentType = 0 + deleteOnClick = FALSE + addOnClick = TRUE + alphaFactor = 1 + iconFile = $(MLAB_MeVisLab_Standard)/Modules/Resources/Images/markerIcons.tif + internalIconFile = "C:/Program Files/MeVisLab2.0VC9/Packages/MeVisLab/Standard/Modules/Resources/Images/markerIcons.tif" + useIconFile = FALSE + iconIdx = 0 + selectingOn = TRUE + actOnReleaseOnly = FALSE + editorMode = EDIT_MARKER + colorMode = COLOR_BY_TYPE + textColorMode = COLOR_TEXT + textMode = TEXT_OFF + textColor = "1 1 1" + textShadow = TRUE + textFontSize = 12 + showTextOnlyForSelectedMarker = FALSE + cutText = FALSE + maxNumberOfLines = 1 + vectorArrow = VECTOR_END_ARROW + useAntiAlias = FALSE + currentStyleIndex = -1 + depthVectorDrawMode = DRAW_NONE + drawMode = DRAW_MARKER + selectiveDrawing = FALSE + selectionBoxesForCurrentOnly = FALSE + cooperative = FALSE + busy = FALSE + instanceName = SoView2DMarkerEditor + listString = "" + numItems = 5 + index = 4 + persistent = FALSE + listStringEnable = FALSE + ownsList = TRUE + applySelect = FALSE + id = 5 + name = "" + newName = "" + actionClass = Modify + actionIndex = 4 + actionId = 5 + currentIndex = 4 + overflowMode = None + maxSize = 0 + useInsertTemplate = FALSE + upToDate = TRUE + posXYZ = "118.5 186.5 0.5" + posC = 0 + posT = 0 + posU = 0 + vecXYZ = "0 0 0" + type = 0 + newPosXYZ = "0 0 0" + newPosC = 0 + newPosT = 0 + newPosU = 0 + newVecXYZ = "0 0 0" + newType = 0 + } +} +module View2D { + internal { + frame = "-115 -235 120 56" + moduleGroupName = "" + windows { + window _default { + geometry = "599 289 400 400" + sizeHint = "400 400" + wasOpen = yes + wasActive = no + } + } + } + fields { + instanceName = View2D + inventorInputOn = TRUE + view2DExtensionsOn = TRUE + startSlice = 0 + numSlices = 1 + numXSlices = 1 + sliceStep = 1 + slab = 1 + blendMode = BLEND_REPLACE + timePoint = 0 + maxTimePoint = 0 + filterMode = FILTER_LINEAR + standardKeys = TRUE + cineMode = CINE_Z + cineDirection = CINE_PINGPONG + cineRepeat = CINE_ONCE + cineSpeed = 0.1000000015 + snapToCenter = FALSE + zoomMode = VIEW2D_AUTO_ZOOM + unzoomOnImageChange = FALSE + sliceZoom = 1 + sliceZoomSynced = 1 + baseColor = "1 1 1" + margin = "2 2" + sliceOrigin = "0 0" + lutCenter = 0.5 + lutWidth = 1 + lutUseTraceColors = FALSE + annotationOn = TRUE + annotationMode = ANNO_MODE_AUTO + annotationSizeMode = ANNO_SHOW_HIDE + annotationCol = "0.8999999761581421 0.8999999761581421 0.8999999761581421" + annotationFontSize = ANNO_SIZE_AUTO + annoCoords = Voxel + annoCTValue = AsIs + borderOn = TRUE + borderColor = "0.8999999761581421 0.8999999761581421 0.8999999761581421" + valueHighPrecision = FALSE + plane = "0 0 1 0.5" + } + internalFields = "" +} +module LinearInterpolateXMarkerList { + internal { + frame = "-95 -27 192 56" + moduleGroupName = "" + windows { + window _default { + geometry = "347 475 174 33" + sizeHint = "174 33" + wasOpen = yes + wasActive = no + } + } + } + fields { + instanceName = LinearInterpolateXMarkerList + sampleDistance = 5 + } +} +connections { + SoGroup.children = "SoView2DMarkerEditor.self SoView2DMarkerEditor1.self" + SoView2DMarkerEditor1.inXMarkerList = LinearInterpolateXMarkerList.outputXMarkerList + View2D.inImage = ConstantImage.output0 + View2D.inInvPreLUT = SoGroup.self + LinearInterpolateXMarkerList.inputXMarkerList = SoView2DMarkerEditor.outXMarkerList +} +networkModel { + parentItems { + 0 { + MLABNetworkModelItem MLABNoteItem { + uniqueId = 15 + objectName = "" + parentUniqueId = 0 + frame = "-414 -238 238 157" + backgroundColor { + r = 252 + g = 242 + b = 2 + a = 255 + } + text = "Click points in the View2D GUI. + +The module will equidistantly linearly interpolate markers between the clicked ones. + +Sample distance can be changed in the LinearInterpolateXMarkerList GUI." + titleText = Comment + isCollapsed = False + } + } + } +} Property changes on: trunk/Community/General/Modules/ML/MLXMarkerListCommunityModules/networks/LinearInterpolateXMarkerListExample.mlab ___________________________________________________________________ Added: svn:keywords + " Date Revision Author HeadURL Id " Added: svn:eol-style + LF Added: trunk/Community/General/Modules/ML/MLXMarkerListCommunityModules/networks/TransformXMarkerList.mlab =================================================================== --- trunk/Community/General/Modules/ML/MLXMarkerListCommunityModules/networks/TransformXMarkerList.mlab (rev 0) +++ trunk/Community/General/Modules/ML/MLXMarkerListCommunityModules/networks/TransformXMarkerList.mlab 2010-03-05 11:26:53 UTC (rev 229) @@ -0,0 +1,375 @@ +// MDL v1 utf8 +network { + watchlist = "" +} +module SoView2DMarkerEditor { + internal { + frame = "581 181 168 56" + moduleGroupName = "" + windows { + window _default { + geometry = "422 91 435 831" + sizeHint = "435 831" + wasOpen = no + wasActive = no + } + } + } + fields { + drawingOn = TRUE + editingOn = FALSE + maskValid = FALSE + fixZOn = TRUE + color = "1 1 0" + selectionTolerance = 2 + needsValidVoxel = TRUE + button1 = PRESSED + button2 = IGNORED + button3 = IGNORED + shift = IGNORED + control = IGNORED + alt = IGNORED + wantsAllEvents = FALSE + wantsKeyEvents = TRUE + wantsMouseWheelEvents = FALSE + setEventHandled = FALSE + ignoreHandledEvents = FALSE + createNewMode = FALSE + renderOnSlab = FALSE + clipToSlice = FALSE + cursorShape = UNDEFINED_CURSOR + depthVisibility = 1 + snapToVoxel = FALSE + snapToSlice = FALSE + currentType = 0 + deleteOnClick = FALSE + addOnClick = FALSE + alphaFactor = 1 + iconFile = $(MLAB_MeVisLab_Standard)/Modules/Resources/Images/markerIcons.tif + internalIconFile = "C:/Program Files/MeVisLab2.0VC9/Packages/MeVisLab/Standard/Modules/Resources/Images/markerIcons.tif" + useIconFile = FALSE + iconIdx = 0 + selectingOn = FALSE + actOnReleaseOnly = FALSE + editorMode = EDIT_MARKER + colorMode = COLOR_BY_TYPE + textColorMode = COLOR_TEXT + textMode = TEXT_OFF + textColor = "1 1 1" + textShadow = TRUE + textFontSize = 12 + showTextOnlyForSelectedMarker = FALSE + cutText = FALSE + maxNumberOfLines = 1 + vectorArrow = VECTOR_END_ARROW + useAntiAlias = FALSE + currentStyleIndex = -1 + depthVectorDrawMode = DRAW_NONE + drawMode = DRAW_MARKER + selectiveDrawing = FALSE + selectionBoxesForCurrentOnly = FALSE + cooperative = FALSE + busy = FALSE + instanceName = SoView2DMarkerEditor1 + listString = "" + numItems = 5 + index = -1 + persistent = FALSE + listStringEnable = FALSE + ownsList = FALSE + applySelect = FALSE + id = -1 + name = "" + newName = "" + actionClass = Select + actionIndex = 4 + actionId = 5 + currentIndex = 4 + overflowMode = None + maxSize = 0 + useInsertTemplate = FALSE + upToDate = TRUE + posXYZ = "0 0 0" + posC = 0 + posT = 0 + posU = 0 + vecXYZ = "0 0 0" + type = 0 + newPosXYZ = "0 0 0" + newPosC = 0 + newPosT = 0 + newPosU = 0 + newVecXYZ = "0 0 0" + newType = 0 + } +} +module SoGroup { + internal { + frame = "569 93 96 56" + moduleGroupName = "" + } + fields { + instanceName = SoGroup + } +} +module SoView2DMarkerEditor { + internal { + frame = "537 365 160 56" + moduleGroupName = "" + windows { + window _default { + geometry = "426 193 435 831" + sizeHint = "435 831" + wasOpen = no + wasActive = no + } + } + } + fields { + drawingOn = TRUE + editingOn = TRUE + maskValid = FALSE + fixZOn = TRUE + color = "1 1 1" + selectionTolerance = 4 + needsValidVoxel = TRUE + button1 = PRESSED + button2 = IGNORED + button3 = IGNORED + shift = IGNORED + control = IGNORED + alt = IGNORED + wantsAllEvents = FALSE + wantsKeyEvents = TRUE + wantsMouseWheelEvents = FALSE + setEventHandled = FALSE + ignoreHandledEvents = FALSE + createNewMode = FALSE + renderOnSlab = FALSE + clipToSlice = FALSE + cursorShape = UNDEFINED_CURSOR + depthVisibility = 1 + snapToVoxel = TRUE + snapToSlice = TRUE + currentType = 0 + deleteOnClick = FALSE + addOnClick = TRUE + alphaFactor = 1 + iconFile = $(MLAB_MeVisLab_Standard)/Modules/Resources/Images/markerIcons.tif + internalIconFile = "C:/Program Files/MeVisLab2.0VC9/Packages/MeVisLab/Standard/Modules/Resources/Images/markerIcons.tif" + useIconFile = FALSE + iconIdx = 0 + selectingOn = TRUE + actOnReleaseOnly = FALSE + editorMode = EDIT_MARKER + colorMode = COLOR_BY_TYPE + textColorMode = COLOR_TEXT + textMode = TEXT_OFF + textColor = "1 1 1" + textShadow = TRUE + textFontSize = 12 + showTextOnlyForSelectedMarker = FALSE + cutText = FALSE + maxNumberOfLines = 1 + vectorArrow = VECTOR_END_ARROW + useAntiAlias = FALSE + currentStyleIndex = -1 + depthVectorDrawMode = DRAW_NONE + drawMode = DRAW_MARKER + selectiveDrawing = FALSE + selectionBoxesForCurrentOnly = FALSE + cooperative = FALSE + busy = FALSE + instanceName = SoView2DMarkerEditor + listString = "[(59.5 158.5 0.5) #1, (111.5 137.5 0.5) #2, (122.5 82.5 0.5) #3, (86.5 54.5 0.5) #4, (136.5 203.5 0.5) #5]" + numItems = 5 + index = 4 + persistent = TRUE + listStringEnable = FALSE + ownsList = TRUE + applySelect = FALSE + id = 5 + name = "" + newName = "" + actionClass = Modify + actionIndex = 4 + actionId = 5 + currentIndex = 4 + overflowMode = None + maxSize = 0 + useInsertTemplate = FALSE + upToDate = TRUE + posXYZ = "136.5 203.5 0.5" + posC = 0 + posT = 0 + posU = 0 + vecXYZ = "0 0 0" + type = 0 + newPosXYZ = "0 0 0" + newPosC = 0 + newPosT = 0 + newPosU = 0 + newVecXYZ = "0 0 0" + newType = 0 + } +} +module ConstantImage { + internal { + frame = "381 365 120 56" + moduleGroupName = "" + windows { + window _default { + geometry = "534 411 219 246" + sizeHint = "219 246" + wasOpen = no + wasActive = no + } + } + } + fields { + instanceName = ConstantImage + sizeX = 256 + sizeY = 256 + sizeZ = 1 + sizeC = 1 + sizeT = 1 + sizeU = 1 + dataType = float + fillValue = 0 + autoApply = TRUE + } +} +module View2D { + internal { + frame = "565 13 120 56" + moduleGroupName = "" + windows { + window _default { + geometry = "552 247 432 458" + sizeHint = "400 400" + wasOpen = yes + wasActive = no + } + } + } + fields { + instanceName = View2D + inventorInputOn = TRUE + view2DExtensionsOn = TRUE + startSlice = 0 + numSlices = 1 + numXSlices = 1 + sliceStep = 1 + slab = 1 + blendMode = BLEND_REPLACE + timePoint = 0 + maxTimePoint = 0 + filterMode = FILTER_LINEAR + standardKeys = TRUE + cineMode = CINE_Z + cineDirection = CINE_PINGPONG + cineRepeat = CINE_ONCE + cineSpeed = 0.1000000015 + snapToCenter = FALSE + zoomMode = VIEW2D_AUTO_ZOOM + unzoomOnImageChange = FALSE + sliceZoom = 1 + sliceZoomSynced = 1 + baseColor = "1 1 1" + margin = "2 2" + sliceOrigin = "0 0" + lutCenter = 0.5 + lutWidth = 1 + lutUseTraceColors = FALSE + annotationOn = TRUE + annotationMode = ANNO_MODE_AUTO + annotationSizeMode = ANNO_SHOW_DETAILED + annotationCol = "0.8999999761581421 0.8999999761581421 0.8999999761581421" + annotationFontSize = ANNO_SIZE_AUTO + annoCoords = Voxel + annoCTValue = AsIs + borderOn = TRUE + borderColor = "0.8999999761581421 0.8999999761581421 0.8999999761581421" + valueHighPrecision = FALSE + plane = "0 0 1 0.5" + } + internalFields = "" +} +module Comment { + internal { + frame = "773 181 88 56" + moduleGroupName = "" + windows { + window _default { + geometry = "792 564 256 209" + sizeHint = "256 209" + wasOpen = no + wasActive = no + } + } + } + fields { + instanceName = Comment + comment = "TransformXMarkerList transforms the input XMarkerList with the given transformation matrix or the transformation matrix composed of the given elementary transforms." + } + internalFields = "" +} +module TransformXMarkerList { + internal { + frame = "565 269 152 56" + moduleGroupName = "" + windows { + window _default { + geometry = "854 142 400 480" + sizeHint = "420 480" + wasOpen = no + wasActive = no + } + } + } + fields { + instanceName = TransformXMarkerList + transformEnabled = TRUE + center = "0 0 0" + scaleOrientation = "0 0 1 0" + scale = "1 1 1" + rotation = "0 0 0 0" + translation = "15 0 0" + useElementaryTransforms = TRUE + matrix = "1 0 0 15 +0 1 0 0 +0 0 1 0 +0 0 0 1" + divideByHomogeneousCoordinate = FALSE + } +} +connections { + SoView2DMarkerEditor1.inXMarkerList = TransformXMarkerList.outputXMarkerList + SoGroup.children = "SoView2DMarkerEditor.self SoView2DMarkerEditor1.self" + View2D.inImage = ConstantImage.output0 + View2D.inInvPreLUT = SoGroup.self + TransformXMarkerList.inputXMarkerList = SoView2DMarkerEditor.outXMarkerList +} +networkModel { + parentItems { + 0 { + MLABNetworkModelItem MLABNoteItem { + uniqueId = 24 + objectName = "" + parentUniqueId = 0 + frame = "168 -65 258 181" + backgroundColor { + r = 252 + g = 242 + b = 2 + a = 255 + } + text = "Click markers in the View2D GUI and see how they are transformed with TransformXMarkerList. + +Changing the elementary transform fields will update the transformation matrix. Disabling the elementary transforms allows the definition of the transformation matrix directly." + titleText = Comment + isCollapsed = False + } + } + } +} Property changes on: trunk/Community/General/Modules/ML/MLXMarkerListCommunityModules/networks/TransformXMarkerList.mlab ___________________________________________________________________ Added: svn:keywords + " Date Revision Author HeadURL Id " Added: svn:eol-style + LF This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rha...@us...> - 2010-03-05 11:21:31
|
Revision: 228 http://mevislabmodules.svn.sourceforge.net/mevislabmodules/?rev=228&view=rev Author: rhameeteman Date: 2010-03-05 11:21:23 +0000 (Fri, 05 Mar 2010) Log Message: ----------- KH. * Added three modules: CSOSetProperties CSOImageStatistics CSOPointsToXMarkers Modified Paths: -------------- trunk/Community/General/Modules/ML/MLCSOCommunityModules/MLCSOCommunityModules.def trunk/Community/General/Sources/ML/MLCSOCommunityModules/MLCSOCommunityModules.pro trunk/Community/General/Sources/ML/MLCSOCommunityModules/MLCSOCommunityModulesInit.cpp Added Paths: ----------- trunk/Community/General/Modules/ML/MLCSOCommunityModules/CSOImageStatistics/ trunk/Community/General/Modules/ML/MLCSOCommunityModules/CSOImageStatistics/CSOImageStatisticsExample.mlab trunk/Community/General/Modules/ML/MLCSOCommunityModules/CSOPointsToXMarkers/ trunk/Community/General/Modules/ML/MLCSOCommunityModules/CSOPointsToXMarkers/CSOPointsToXMarkers.html trunk/Community/General/Modules/ML/MLCSOCommunityModules/CSOPointsToXMarkers/CSOPointsToXMarkersExample.mlab trunk/Community/General/Modules/ML/MLCSOCommunityModules/CSOSetProperties/ trunk/Community/General/Modules/ML/MLCSOCommunityModules/CSOSetProperties/CSOSetProperties.py trunk/Community/General/Modules/ML/MLCSOCommunityModules/CSOSetProperties/CSOSetProperties.script trunk/Community/General/Modules/ML/MLCSOCommunityModules/CSOSetProperties/CSOSetPropertiesExample.mlab trunk/Community/General/Sources/ML/MLCSOCommunityModules/CSOImageStatistics/ trunk/Community/General/Sources/ML/MLCSOCommunityModules/CSOImageStatistics/MainAxisPCA.cpp trunk/Community/General/Sources/ML/MLCSOCommunityModules/CSOImageStatistics/MainAxisPCA.h trunk/Community/General/Sources/ML/MLCSOCommunityModules/CSOImageStatistics/MainAxisPCAMatrixRoutines.h trunk/Community/General/Sources/ML/MLCSOCommunityModules/CSOImageStatistics/mlCSOImageStatistics.cpp trunk/Community/General/Sources/ML/MLCSOCommunityModules/CSOImageStatistics/mlCSOImageStatistics.h trunk/Community/General/Sources/ML/MLCSOCommunityModules/CSOPointsToXMarkers/ trunk/Community/General/Sources/ML/MLCSOCommunityModules/CSOPointsToXMarkers/mlCSOPointsToXMarkers.cpp trunk/Community/General/Sources/ML/MLCSOCommunityModules/CSOPointsToXMarkers/mlCSOPointsToXMarkers.h trunk/Community/General/Sources/ML/MLCSOCommunityModules/CSOSetProperties/ trunk/Community/General/Sources/ML/MLCSOCommunityModules/CSOSetProperties/mlCSOSetProperties.cpp trunk/Community/General/Sources/ML/MLCSOCommunityModules/CSOSetProperties/mlCSOSetProperties.h Added: trunk/Community/General/Modules/ML/MLCSOCommunityModules/CSOImageStatistics/CSOImageStatisticsExample.mlab =================================================================== --- trunk/Community/General/Modules/ML/MLCSOCommunityModules/CSOImageStatistics/CSOImageStatisticsExample.mlab (rev 0) +++ trunk/Community/General/Modules/ML/MLCSOCommunityModules/CSOImageStatistics/CSOImageStatisticsExample.mlab 2010-03-05 11:21:23 UTC (rev 228) @@ -0,0 +1,693 @@ +// MDL v1 utf8 +network { + watchlist = "" +} +module SoRenderArea { + internal { + frame = "433 93 112 56" + moduleGroupName = "" + windows { + window _viewer { + geometry = "363 122 400 400" + sizeHint = "400 400" + wasOpen = yes + wasActive = no + } + } + } + fields { + instanceName = SoRenderArea + renderCaching = AUTO + boundingBoxCaching = AUTO + renderCulling = AUTO + pickCulling = AUTO + border = FALSE + background = "0 0 0" + transparency = BLEND + antialiasing = FALSE + antialiasingNumPasses = 1 + grabKeyFocus = TRUE + snapshotFormat = SNAPSHOT_RGB + outputAviFile = "" + autoRedrawWhenRecording = TRUE + frameRate = 7 + frameRateAvi = 15 + status = ready + outputSnapshotFile = none + outputSnapshotFileWritten = none + autoIncreaseFile = TRUE + autoUpdateML = FALSE + showSnapshotWithShell = FALSE + snapCount = 0 + } +} +module SoExaminerViewer { + internal { + frame = "589 93 136 56" + moduleGroupName = "" + windows { + window _viewer { + geometry = "773 122 420 399" + sizeHint = "400 400" + wasOpen = yes + wasActive = no + } + } + } + fields { + instanceName = SoExaminerViewer + renderCaching = AUTO + boundingBoxCaching = AUTO + renderCulling = AUTO + pickCulling = AUTO + border = FALSE + background = "0 0 0" + transparency = BLEND + antialiasing = FALSE + antialiasingNumPasses = 1 + grabKeyFocus = TRUE + snapshotFormat = SNAPSHOT_RGB + outputAviFile = "" + autoRedrawWhenRecording = TRUE + frameRate = 7 + frameRateAvi = 15 + status = ready + outputSnapshotFile = none + outputSnapshotFileWritten = none + autoIncreaseFile = TRUE + autoUpdateML = FALSE + showSnapshotWithShell = FALSE + snapCount = 0 + headlight = TRUE + decoration = TRUE + popupMenuEnabled = FALSE + viewing = TRUE + autoClipping = TRUE + externalCamera = FALSE + drawStyle = VIEW_AS_IS + interactiveDrawStyle = VIEW_LOW_COMPLEXITY + viewAllFlag = FALSE + initialCameraOrientation = CAMERA_KEEP_AS_IS + applyCameraOrientation = CAMERA_KEEP_AS_IS + cameraType = CAMERA_PERSPECTIVE + userSettingOrientation = "0 0 1 0" + automaticViewAll = FALSE + storeCurrentState = TRUE + saveCamera = TRUE + cursor = TRUE + isCameraStored = TRUE + perspective = TRUE + stereoViewing = FALSE + stereoOffset = 3 + height = 0.7853981853 + position = "-55.24962615966797 91.613037109375 -1.084884643554688" + orientation = "0.712742030620575 0.4398597776889801 -0.5463717579841614 3.836323738098145" + nearDistance = 86.19510651 + farDistance = 189.1821899 + focalDistance = 137.6403809 + forceRedrawOnInteraction = FALSE + button1events = TO_VIEWER + button2events = TO_VIEWER + button3events = TO_VIEWER + keyEvents = TO_VIEWER + animationEnabled = FALSE + feedback = FALSE + feedbackSize = 32 + mouseInteraction = "" + rotationAxis = "0 1 0" + rotationAngle = 360 + rotationSteps = 80 + rotationCurrentStep = 0 + recordRotation = TRUE + } +} +module So3DXMarker { + internal { + frame = "653 173 120 56" + moduleGroupName = "" + windows { + window _default { + geometry = "641 167 292 745" + sizeHint = "292 745" + wasOpen = no + wasActive = no + } + } + } + fields { + renderCaching = AUTO + boundingBoxCaching = AUTO + renderCulling = AUTO + pickCulling = AUTO + scaleSize = 1 + scaleLength = 1 + color = "0.3333333432674408 0.6666666865348816 1" + validStylePalette = TRUE + enableVector = FALSE + drawingOn = TRUE + editingOn = TRUE + selectingOn = TRUE + deleteOnClick = FALSE + addOnClick = TRUE + edit3DOn = FALSE + edit3DVector = FALSE + colorMode = COLOR_BY_TYPE + markerType = 0 + textColorMode = COLOR_TEXT + textMode = TEXT_OFF + textColor = "1 1 1" + textShadow = TRUE + vectorArrow = VECTOR_NO_ARROWS + lineStyle = Solid + drawMode = DrawModeCorrect + instanceName = So3DXMarker + listString = "" + numItems = 2845 + index = 0 + persistent = FALSE + listStringEnable = FALSE + ownsList = FALSE + applySelect = FALSE + id = 0 + name = "" + newName = "" + actionClass = New + actionIndex = -1 + actionId = -1 + currentIndex = -1 + overflowMode = None + maxSize = 0 + useInsertTemplate = FALSE + upToDate = TRUE + posXYZ = "39.89910507202148 62.53080749511719 45.50000381469727" + posC = 0 + posT = 0 + posU = 0 + vecXYZ = "0 0 0" + type = 0 + newPosXYZ = "0 0 0" + newPosC = 0 + newPosT = 0 + newPosU = 0 + newVecXYZ = "0 0 0" + newType = 0 + } +} +module SoCSO3DVis { + internal { + frame = "549 173 104 56" + moduleGroupName = "" + windows { + window _default { + geometry = "168 318 258 298" + sizeHint = "258 298" + wasOpen = no + wasActive = no + } + } + } + fields { + instanceName = SoCSO3DVis + renderCaching = AUTO + boundingBoxCaching = AUTO + renderCulling = AUTO + pickCulling = AUTO + autoApply = TRUE + lineWidthOffset = 0 + markerSizeScaling = 1 + highlightSelectedGroups = TRUE + useRenderTimeDelay = FALSE + timerDelayMilliSeconds = 100 + useStylePalette = TRUE + stylePaletteUseIndexAs = USE_INDEX_FOR_CSO + listenToRepaintNotifications = FALSE + listenToFinishingNotifications = TRUE + listenToSelectionChangedNotifications = TRUE + } +} +module LocalImage { + internal { + frame = "241 533 96 56" + moduleGroupName = "" + windows { + window _default { + geometry = "717 524 492 211" + sizeHint = "492 211" + wasOpen = no + wasActive = no + } + } + } + fields { + instanceName = LocalImage + name = $(DemoDataPath)/PIDunknown.134x124x46.roi.ul.tiff + trueName = "C:/Program Files/MeVisLab2.0VC9/Packages/MeVisLab/Resources/DemoData/PIDunknown.134x124x46.roi.ul.tiff" + autoLoad = TRUE + status = "File open" + } + internalFields = "" +} +module StylePalette { + internal { + frame = "561 341 96 56" + moduleGroupName = "" + } + fields { + instanceName = StylePalette + color1 = "1 1 0" + color2 = "1 0 0" + color3 = "0 0 1" + color4 = "0 1 0" + color5 = "1 0.5 0" + color6 = "1 0 1" + color7 = "0 1 1" + color8 = "0.5 1 0.5" + color9 = "1 0 0.5" + color10 = "0.5 1 0" + color11 = "0.5 0 1" + color12 = "0 1 0.5" + lineStyle1 = Solid + lineStyle2 = Solid + lineStyle3 = Solid + lineStyle4 = Solid + lineStyle5 = Solid + lineStyle6 = Solid + lineStyle7 = Solid + lineStyle8 = Solid + lineStyle9 = Solid + lineStyle10 = Solid + lineStyle11 = Solid + lineStyle12 = Solid + lineWidth1 = 1 + lineWidth2 = 1 + lineWidth3 = 1 + lineWidth4 = 1 + lineWidth5 = 1 + lineWidth6 = 1 + lineWidth7 = 1 + lineWidth8 = 1 + lineWidth9 = 1 + lineWidth10 = 1 + lineWidth11 = 1 + lineWidth12 = 1 + markerType1 = None + markerType2 = None + markerType3 = None + markerType4 = None + markerType5 = None + markerType6 = None + markerType7 = None + markerType8 = None + markerType9 = None + markerType10 = None + markerType11 = None + markerType12 = None + markerSize1 = 4 + markerSize2 = 4 + markerSize3 = 4 + markerSize4 = 4 + markerSize5 = 4 + markerSize6 = 4 + markerSize7 = 4 + markerSize8 = 4 + markerSize9 = 4 + markerSize10 = 4 + markerSize11 = 4 + markerSize12 = 4 + antiAlias1 = FALSE + antiAlias2 = FALSE + antiAlias3 = FALSE + antiAlias4 = FALSE + antiAlias5 = FALSE + antiAlias6 = FALSE + antiAlias7 = FALSE + antiAlias8 = FALSE + antiAlias9 = FALSE + antiAlias10 = FALSE + antiAlias11 = FALSE + antiAlias12 = FALSE + name1 = "" + name2 = "" + name3 = "" + name4 = "" + name5 = "" + name6 = "" + name7 = "" + name8 = "" + name9 = "" + name10 = "" + name11 = "" + name12 = "" + currentStyle = 0 + currentColor = "1 1 1" + currentLineStyle = None + currentLineWidth = 1 + currentMarkerType = None + currentMarkerSize = 4 + currentAntiAlias = FALSE + currentName = "" + reservedEntries = 0 + } +} +module Diagram2D { + internal { + frame = "441 173 96 56" + moduleGroupName = "" + windows { + window _default { + geometry = "590 388 444 576" + sizeHint = "444 576" + wasOpen = no + wasActive = no + } + } + } + fields { + instanceName = Diagram2D + minX = 0 + maxX = 8 + autoRangeX = TRUE + minY = 1042.484619 + maxY = 1170.706299 + autoRangeY = TRUE + axisColor = "1 1 1" + axisRotation = LeftBottom + drawDiagramTitle = FALSE + diagramTitleString = "" + borderH = 39 + autoBorderH = TRUE + borderV = 25 + autoBorderV = TRUE + drawAxisX = TRUE + drawTicksX = TRUE + drawLabelsX = TRUE + drawAxisTitleX = FALSE + axisTitleStringX = "X [dn]" + drawAxisY = TRUE + drawTicksY = TRUE + drawLabelsY = TRUE + drawAxisTitleY = FALSE + axisTitleStringY = "Y [dn]" + curveColor = "1 1 1" + lineStyle = Solid + markerType = None + markerSize = 10 + areaOpacity = 0.5 + lineWidth = 1 + antiAlias = FALSE + button1 = IGNORED + button2 = IGNORED + button3 = IGNORED + shift = IGNORED + ctrl = IGNORED + alt = IGNORED + mousePosX = -0.9811320305 + mousePosY = 1179.600342 + mousePosValid = TRUE + curveSelection = Diagram + selectionTolerance = 5 + selectedCurve = -1 + selectedSeries = -1 + selectedSeriesGlobal = -1 + selectedPoint = -1 + maskValid = TRUE + } +} +module CSOFreehandProcessor { + internal { + frame = "453 429 168 56" + moduleGroupName = "" + } + fields { + instanceName = CSOFreehandProcessor + addCSOToGroupWithLabel = "" + id = 0 + pathPointLineStyle = LineStyleSolid + pathPointLineWidth = 1 + pathPointColor = "1 1 0" + pathPointAlpha = 1 + markerMode = MarkerModeNone + markerSize = 2 + markerColor = "0 1 0" + markerAlpha = 1 + voxelWriteMode = VoxelWriteModeModule + voxelWriteValue = 1024 + creationMode = CreationModeClosedFreehand + interpolationMode = InterpolationModeSplineApproximation + seedPlacementPolicy = PlaceSeedPointWhileDragging + finishingMode = FinishOnRelease + minNumSeedPoints = 0 + minSeedPointDistance = 8 + shouldCloseOnFinish = TRUE + useFinishingDistance = TRUE + finishingDistance = 24 + numInterpolationSteps = 1 + } +} +module SoView2DCSOEditor { + internal { + frame = "301 229 152 56" + moduleGroupName = "" + windows { + window _default { + geometry = "364 302 558 465" + sizeHint = "558 465" + wasOpen = no + wasActive = no + } + } + } + fields { + instanceName = SoView2DCSOEditor + drawingOn = TRUE + editingOn = TRUE + maskValid = FALSE + fixZOn = TRUE + color = "1 1 1" + selectionTolerance = 24 + needsValidVoxel = TRUE + button1 = PRESSED + button2 = IGNORED + button3 = IGNORED + shift = IGNORED + control = IGNORED + alt = IGNORED + wantsAllEvents = TRUE + wantsKeyEvents = TRUE + wantsMouseWheelEvents = FALSE + setEventHandled = FALSE + ignoreHandledEvents = FALSE + createNewMode = FALSE + renderOnSlab = FALSE + clipToSlice = FALSE + cursorShape = UNDEFINED_CURSOR + shouldListenToRepaintEvents = TRUE + shouldListenToSelectionChangedEvents = TRUE + shouldListenToFinishedEvents = TRUE + generalInteractionMode = INTERACTION_MODE_EDIT + generalInteractionModeToggleKey = TOGGLE_MODE_ALT + useAntiAliasing = TRUE + useInterpolationTargetColor = TRUE + interpolationTargetColor = "1 0 0" + showBoundingBox = FALSE + boundingBoxAlpha = 0.5 + boundingBoxColor = "1 1 1" + showOnlyParallelCSOs = FALSE + showParallelDotProductLimitRadian = 0.9998999834 + shouldLevelCSO = FALSE + useStylePalette = TRUE + stylePaletteUseIndexAs = USE_INDEX_FOR_CSO + labelShowMode = LABEL_SHOW_CSO_DESCRIPTION + labelAlignmentMode = LABEL_ALIGN_TOP + labelUnitScale = LABEL_UNIT_SCALE_MM + showLabelUnits = TRUE + labelFontSize = 12 + labelUseTextShadow = TRUE + labelMarginX = 2 + labelMarginY = 2 + ghostMode = GHOST_BOTH_SIDES + ghostUnitMode = GHOST_UNIT_SLICE + ghostStyleAlpha = TRUE + ghostStyleStipple = TRUE + ghostStyleLineWidth = FALSE + ghostStyleBrighten = FALSE + ghostDepth = 5 + generalLabelColor = "1 1 1" + generalLabelAlpha = 1 + labelColorMode = COLOR_GENERAL + useTesselation = FALSE + tesselationColorMode = COLOR_AS_CSO + tesselationColor = "0.8999999761581421 0.5 0.8999999761581421" + tesselationAlpha = 0.200000003 + tesselationWindingRule = WR_ODD + selectGroupsParsProToto = TRUE + highlightSelectedGroups = FALSE + enableMouseOverHighlighting = TRUE + mouseOverColorMode = HIGHLIGHT_COLOR_MODE_FIXED + mouseOverColorBrightenValue = 0.8000000119 + mouseOverColorColor = "1 1 1" + mouseOverLineWidthMode = HIGHLIGHT_LINE_WIDEN + mouseOverLineWidthWidenValue = 0 + mouseOverLineWidthLineWidth = 1 + useIconFile = FALSE + iconFile = $(MLAB_MeVisLab_Standard)/Modules/Resources/Images/markerIcons.tif + internalIconFile = "C:/Program Files/MeVisLab2.0VC9/Packages/MeVisLab/Standard/Modules/Resources/Images/markerIcons.tif" + cutCopyKeyModifier = EDIT_OP_KEY_MOD_CONTROL + copyKeyModifier = EDIT_OP_KEY_MOD_CONTROL + pasteKeyModifier = EDIT_OP_KEY_MOD_CONTROL + undoKeyModifier = EDIT_OP_KEY_MOD_CONTROL + redoKeyModifier = EDIT_OP_KEY_MOD_CONTROL + deleteSeedPointKeyModifier = EDIT_OP_KEY_MOD_NONE + deleteCSOKeyModifier = EDIT_OP_KEY_MOD_SHIFT + multiSelectionKeyModifier = EDIT_OP_KEY_MOD_CONTROL + enableMultiSelection = TRUE + cutCopyKey = EDIT_OP_KEY_X + copyKey = EDIT_OP_KEY_C + pasteKey = EDIT_OP_KEY_V + undoKey = EDIT_OP_KEY_Z + redoKey = EDIT_OP_KEY_Y + deleteSeedPointKey = EDIT_OP_KEY_DELETE + deleteCSOKey = EDIT_OP_KEY_DELETE + nextInteractionStatus = INTERACTIVE_MODE_START_CSO + forceStartNewCSOKeyModifier = EDIT_OP_KEY_MOD_NONE + forceStartNewCSOKey = EDIT_OP_KEY_F + } +} +module View2D { + internal { + frame = "261 93 120 56" + moduleGroupName = "" + windows { + window _default { + geometry = "6 120 346 402" + sizeHint = "400 400" + wasOpen = yes + wasActive = no + } + } + } + fields { + instanceName = View2D + inventorInputOn = TRUE + view2DExtensionsOn = TRUE + startSlice = 38 + numSlices = 1 + numXSlices = 1 + sliceStep = 1 + slab = 1 + blendMode = BLEND_REPLACE + timePoint = 0 + maxTimePoint = 0 + filterMode = FILTER_LINEAR + standardKeys = TRUE + cineMode = CINE_Z + cineDirection = CINE_PINGPONG + cineRepeat = CINE_ONCE + cineSpeed = 0.1000000015 + snapToCenter = FALSE + zoomMode = VIEW2D_AUTO_ZOOM + unzoomOnImageChange = FALSE + sliceZoom = 1 + sliceZoomSynced = 1 + baseColor = "1 1 1" + margin = "2 2" + sliceOrigin = "0 0" + lutCenter = 2047.5 + lutWidth = 4095 + lutUseTraceColors = FALSE + annotationOn = TRUE + annotationMode = ANNO_MODE_AUTO + annotationSizeMode = ANNO_SHOW_DETAILED + annotationCol = "0.8999999761581421 0.8999999761581421 0.8999999761581421" + annotationFontSize = ANNO_SIZE_AUTO + annoCoords = Voxel + annoCTValue = AsIs + borderOn = TRUE + borderColor = "0.8999999761581421 0.8999999761581421 0.8999999761581421" + valueHighPrecision = FALSE + plane = "0 0 1 38.5" + } + internalFields = "" +} +module LocalCSOLoad { + internal { + frame = "469 533 120 56" + moduleGroupName = "" + windows { + window _default { + geometry = "-22 629 1088 256" + sizeHint = "455 256" + wasOpen = no + wasActive = no + } + } + } + fields { + instanceName = LocalCSOLoad + name = $(MLAB_MeVisLab_Standard)/Modules/ML/MLCSOModules/CSOMerge/kidney.cso + autoApply = TRUE + status = "File loaded." + loadSuccess = TRUE + } + internalFields = "" +} +module CSOImageStatistics { + internal { + frame = "305 429 144 56" + moduleGroupName = "" + windows { + window _default { + geometry = "313 623 322 356" + sizeHint = "322 356" + wasOpen = no + wasActive = no + } + } + } + fields { + instanceName = CSOImageStatistics + inputCSOString = -1 + addDescription = TRUE + descriptionString = "Sum:%sum / Average:%average" + outputCurve = TRUE + workDirectlyOnInputList = FALSE + listenToFinishingNotifications = TRUE + listenToSelectionNotifications = TRUE + updateMode = Off + useAllPointsInsideCSO = TRUE + averageOutput = TRUE + sumOutput = FALSE + resolution = -1 + useVoxelSize = TRUE + statistics = "Id;Voxels;Sum;Average +1;442;473393;1138.11 +2;421;451051;1119.61 +3;483;521660;1124.51 +4;101;104311;1097.15 +5;102;107386;1170.71 +6;465;493490;1092.91 +7;316;337427;1069.04 +8;408;433232;1138.93 +9;107;110105;1042.48 +" + interpolation = Trilinear + memoryAccess = Global + } +} +connections { + SoRenderArea.children = Diagram2D.outNode + SoExaminerViewer.children = "SoCSO3DVis.self So3DXMarker.self" + So3DXMarker.stylePalette = StylePalette.outStylePalette + So3DXMarker.inXMarkerList = CSOImageStatistics.outCoordinateList + SoCSO3DVis.inCSOList = CSOImageStatistics.outCSOList + SoCSO3DVis.inStylePalette = StylePalette.outStylePalette + Diagram2D.inCurveList = CSOImageStatistics.outCurveList + SoView2DCSOEditor.inCSOList = CSOImageStatistics.outCSOList + SoView2DCSOEditor.inProcessor = CSOFreehandProcessor.outProcessorData + SoView2DCSOEditor.inStylePalette = StylePalette.outStylePalette + View2D.inImage = LocalImage.outImage + View2D.inInvPostLUT = SoView2DCSOEditor.self + CSOImageStatistics.input0 = LocalImage.outImage + CSOImageStatistics.inCSOList = LocalCSOLoad.outCSOList +} +networkModel = "" Added: trunk/Community/General/Modules/ML/MLCSOCommunityModules/CSOPointsToXMarkers/CSOPointsToXMarkers.html =================================================================== --- trunk/Community/General/Modules/ML/MLCSOCommunityModules/CSOPointsToXMarkers/CSOPointsToXMarkers.html (rev 0) +++ trunk/Community/General/Modules/ML/MLCSOCommunityModules/CSOPointsToXMarkers/CSOPointsToXMarkers.html 2010-03-05 11:21:23 UTC (rev 228) @@ -0,0 +1,77 @@ +<!doctype html public "-//w3c//dtd html 4.0 transitional//en"> +<html> +<head> + <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> + <meta name="GENERATOR" content="Mozilla/4.78 [en] (Windows NT 5.0; U) [Netscape]"> + <meta name="Description" content="MeVisLab module help page template"> + <title>Module Help Page</title> +</head> +<body> + +<center><a href="#Purpose">Purpose</a> <a href="#Usage">Usage</a> <a href="#Details">Details</a> <a href="#InputFields">Input</a> <a href="#OutputFields">Output</a> <a href="#Parameters">Parameters</a> + <a href="#Example">Example</a> +<hr WIDTH="100%"></center> +<h2>CSOPointsToXMarkers</h2> + +<h3><a NAME=Purpose></a>Purpose</h3> +<blockquote>Output the points of a CSO in an XMarkerList. CSO normals can be computes as well and are then outputted in the vector element of the markers. +</blockquote> + +<h3><a NAME=Usage></a>Usage</h3> +<blockquote>Connect CSOList, enter index of CSO to output and change settings. +</blockquote> + +<h3><a NAME=Details></a>Details</h3> +<blockquote>Normals are computed by computing the outer product of the plane normal in which the CSO lies and the vectors between the CSO points. +</blockquote> + +<h3><a NAME="InputFields"></a>Input</h3> +<blockquote> <ul> + <li> + <b>inputCSOList</b> + Input CSOList + </li> + </ul> + +</blockquote> + +<h3><a NAME="OutputFields"></a>Output</h3> +<blockquote> <ul> + <li> + <b>outputXMarkerList</b> + Output XMarkerList + </li> + </ul> + +</blockquote> + +<h3><a NAME="Parameters"></a>Parameters</h3> +<blockquote> <ul> + <li> + <b>listIndexFld</b> + Index of CSO in CSOList to convert (-1 = all) + </li> + <li> + <b>convertPathPoints</b> + Enable/disable conversion of pathpoints + </li> + <li> + <b>outputCSONormals</b> + Enable/disable computation and output of CSO normals in vector elements of XMarkerList + </li> + </ul> + +</blockquote> + + + +<h3><a NAME=Example></a>Example</h3> +<blockquote>See example network. +</blockquote> + + + + + +</body> +</html> Added: trunk/Community/General/Modules/ML/MLCSOCommunityModules/CSOPointsToXMarkers/CSOPointsToXMarkersExample.mlab =================================================================== --- trunk/Community/General/Modules/ML/MLCSOCommunityModules/CSOPointsToXMarkers/CSOPointsToXMarkersExample.mlab (rev 0) +++ trunk/Community/General/Modules/ML/MLCSOCommunityModules/CSOPointsToXMarkers/CSOPointsToXMarkersExample.mlab 2010-03-05 11:21:23 UTC (rev 228) @@ -0,0 +1,476 @@ +// MDL v1 utf8 +network { + watchlist = "" +} +module SoGroup { + internal { + frame = "753 125 96 56" + moduleGroupName = "" + } + fields { + instanceName = SoGroup + } +} +module SoView2DMarkerEditor { + internal { + frame = "673 205 160 56" + moduleGroupName = "" + windows { + window _default { + geometry = "528 116 435 831" + sizeHint = "435 831" + wasOpen = no + wasActive = no + } + } + } + fields { + drawingOn = TRUE + editingOn = FALSE + maskValid = FALSE + fixZOn = TRUE + color = "1 0 0" + selectionTolerance = 3 + needsValidVoxel = TRUE + button1 = PRESSED + button2 = IGNORED + button3 = IGNORED + shift = IGNORED + control = IGNORED + alt = IGNORED + wantsAllEvents = FALSE + wantsKeyEvents = TRUE + wantsMouseWheelEvents = FALSE + setEventHandled = FALSE + ignoreHandledEvents = FALSE + createNewMode = FALSE + renderOnSlab = FALSE + clipToSlice = FALSE + cursorShape = UNDEFINED_CURSOR + depthVisibility = 1 + snapToVoxel = FALSE + snapToSlice = FALSE + currentType = 0 + deleteOnClick = FALSE + addOnClick = FALSE + alphaFactor = 1 + iconFile = $(MLAB_MeVisLab_Standard)/Modules/Resources/Images/markerIcons.tif + internalIconFile = "C:/Program Files/MeVisLab2.0VC9/Packages/MeVisLab/Standard/Modules/Resources/Images/markerIcons.tif" + useIconFile = FALSE + iconIdx = 0 + selectingOn = FALSE + actOnReleaseOnly = FALSE + editorMode = EDIT_MARKER + colorMode = COLOR_BY_TYPE + textColorMode = COLOR_TEXT + textMode = TEXT_OFF + textColor = "1 1 1" + textShadow = TRUE + textFontSize = 12 + showTextOnlyForSelectedMarker = FALSE + cutText = FALSE + maxNumberOfLines = 1 + vectorArrow = VECTOR_NO_ARROWS + useAntiAlias = FALSE + currentStyleIndex = -1 + depthVectorDrawMode = DRAW_NONE + drawMode = DRAW_MARKER + selectiveDrawing = FALSE + selectionBoxesForCurrentOnly = FALSE + cooperative = FALSE + busy = FALSE + instanceName = SoView2DMarkerEditor + listString = "" + numItems = 130 + index = 0 + persistent = FALSE + listStringEnable = FALSE + ownsList = FALSE + applySelect = FALSE + id = 1447 + name = "" + newName = "" + actionClass = Insert + actionIndex = 129 + actionId = 1576 + currentIndex = 129 + overflowMode = None + maxSize = 0 + useInsertTemplate = FALSE + upToDate = TRUE + posXYZ = "77.58567810058594 105.0843963623047 0.5" + posC = 0 + posT = 0 + posU = 0 + vecXYZ = "-0.7592560670601622 -0.6507919979781056 2.503193737840202e-18" + type = 0 + newPosXYZ = "0 0 0" + newPosC = 0 + newPosT = 0 + newPosU = 0 + newVecXYZ = "0 0 0" + newType = 0 + } +} +module CSOFreehandProcessor { + internal { + frame = "701 461 168 56" + moduleGroupName = "" + } + fields { + instanceName = CSOFreehandProcessor + addCSOToGroupWithLabel = "" + id = 0 + pathPointLineStyle = LineStyleSolid + pathPointLineWidth = 1 + pathPointColor = "1 1 0" + pathPointAlpha = 1 + markerMode = MarkerModeNone + markerSize = 2 + markerColor = "0 1 0" + markerAlpha = 1 + voxelWriteMode = VoxelWriteModeModule + voxelWriteValue = 1024 + creationMode = CreationModeClosedFreehand + interpolationMode = InterpolationModeSplineApproximation + seedPlacementPolicy = PlaceSeedPointWhileDragging + finishingMode = FinishOnRelease + minNumSeedPoints = 0 + minSeedPointDistance = 8 + shouldCloseOnFinish = TRUE + useFinishingDistance = TRUE + finishingDistance = 24 + numInterpolationSteps = 1 + } +} +module SoView2DCSOEditor { + internal { + frame = "741 317 152 56" + moduleGroupName = "" + } + fields { + instanceName = SoView2DCSOEditor + drawingOn = TRUE + editingOn = TRUE + maskValid = FALSE + fixZOn = TRUE + color = "1 1 1" + selectionTolerance = 24 + needsValidVoxel = TRUE + button1 = PRESSED + button2 = IGNORED + button3 = IGNORED + shift = IGNORED + control = IGNORED + alt = IGNORED + wantsAllEvents = TRUE + wantsKeyEvents = TRUE + wantsMouseWheelEvents = FALSE + setEventHandled = FALSE + ignoreHandledEvents = FALSE + createNewMode = FALSE + renderOnSlab = FALSE + clipToSlice = FALSE + cursorShape = UNDEFINED_CURSOR + shouldListenToRepaintEvents = TRUE + shouldListenToSelectionChangedEvents = TRUE + shouldListenToFinishedEvents = TRUE + generalInteractionMode = INTERACTION_MODE_EDIT + generalInteractionModeToggleKey = TOGGLE_MODE_ALT + useAntiAliasing = TRUE + useInterpolationTargetColor = TRUE + interpolationTargetColor = "1 0 0" + showBoundingBox = FALSE + boundingBoxAlpha = 0.5 + boundingBoxColor = "1 1 1" + showOnlyParallelCSOs = FALSE + showParallelDotProductLimitRadian = 0.9998999834 + shouldLevelCSO = FALSE + useStylePalette = FALSE + stylePaletteUseIndexAs = USE_INDEX_FOR_CSO + labelShowMode = LABEL_SHOW_NONE + labelAlignmentMode = LABEL_ALIGN_CENTER + labelUnitScale = LABEL_UNIT_SCALE_MM + showLabelUnits = TRUE + labelFontSize = 12 + labelUseTextShadow = TRUE + labelMarginX = 2 + labelMarginY = 2 + ghostMode = GHOST_BOTH_SIDES + ghostUnitMode = GHOST_UNIT_SLICE + ghostStyleAlpha = TRUE + ghostStyleStipple = TRUE + ghostStyleLineWidth = FALSE + ghostStyleBrighten = FALSE + ghostDepth = 5 + generalLabelColor = "1 1 1" + generalLabelAlpha = 1 + labelColorMode = COLOR_GENERAL + useTesselation = FALSE + tesselationColorMode = COLOR_AS_CSO + tesselationColor = "0.8999999761581421 0.5 0.8999999761581421" + tesselationAlpha = 0.200000003 + tesselationWindingRule = WR_ODD + selectGroupsParsProToto = TRUE + highlightSelectedGroups = FALSE + enableMouseOverHighlighting = TRUE + mouseOverColorMode = HIGHLIGHT_COLOR_MODE_FIXED + mouseOverColorBrightenValue = 0.8000000119 + mouseOverColorColor = "1 1 1" + mouseOverLineWidthMode = HIGHLIGHT_LINE_WIDEN + mouseOverLineWidthWidenValue = 0 + mouseOverLineWidthLineWidth = 1 + useIconFile = FALSE + iconFile = $(MLAB_MeVisLab_Standard)/Modules/Resources/Images/markerIcons.tif + internalIconFile = "C:/Program Files/MeVisLab2.0VC9/Packages/MeVisLab/Standard/Modules/Resources/Images/markerIcons.tif" + cutCopyKeyModifier = EDIT_OP_KEY_MOD_CONTROL + copyKeyModifier = EDIT_OP_KEY_MOD_CONTROL + pasteKeyModifier = EDIT_OP_KEY_MOD_CONTROL + undoKeyModifier = EDIT_OP_KEY_MOD_CONTROL + redoKeyModifier = EDIT_OP_KEY_MOD_CONTROL + deleteSeedPointKeyModifier = EDIT_OP_KEY_MOD_NONE + deleteCSOKeyModifier = EDIT_OP_KEY_MOD_SHIFT + multiSelectionKeyModifier = EDIT_OP_KEY_MOD_CONTROL + enableMultiSelection = TRUE + cutCopyKey = EDIT_OP_KEY_X + copyKey = EDIT_OP_KEY_C + pasteKey = EDIT_OP_KEY_V + undoKey = EDIT_OP_KEY_Z + redoKey = EDIT_OP_KEY_Y + deleteSeedPointKey = EDIT_OP_KEY_DELETE + deleteCSOKey = EDIT_OP_KEY_DELETE + nextInteractionStatus = INTERACTIVE_MODE_START_CSO + forceStartNewCSOKeyModifier = EDIT_OP_KEY_MOD_NONE + forceStartNewCSOKey = EDIT_OP_KEY_F + } +} +module View2D { + internal { + frame = "725 29 120 56" + moduleGroupName = "" + windows { + window _default { + geometry = "835 149 400 400" + sizeHint = "400 400" + wasOpen = yes + wasActive = no + } + } + } + fields { + instanceName = View2D + inventorInputOn = TRUE + view2DExtensionsOn = TRUE + startSlice = 0 + numSlices = 1 + numXSlices = 1 + sliceStep = 1 + slab = 1 + blendMode = BLEND_REPLACE + timePoint = 0 + maxTimePoint = 0 + filterMode = FILTER_LINEAR + standardKeys = TRUE + cineMode = CINE_Z + cineDirection = CINE_PINGPONG + cineRepeat = CINE_ONCE + cineSpeed = 0.1000000015 + snapToCenter = FALSE + zoomMode = VIEW2D_AUTO_ZOOM + unzoomOnImageChange = FALSE + sliceZoom = 1 + sliceZoomSynced = 1 + baseColor = "1 1 1" + margin = "2 2" + sliceOrigin = "0 0" + lutCenter = 0.5 + lutWidth = 1 + lutUseTraceColors = FALSE + annotationOn = TRUE + annotationMode = ANNO_MODE_AUTO + annotationSizeMode = ANNO_SHOW_DETAILED + annotationCol = "0.8999999761581421 0.8999999761581421 0.8999999761581421" + annotationFontSize = ANNO_SIZE_AUTO + annoCoords = Voxel + annoCTValue = AsIs + borderOn = TRUE + borderColor = "0.8999999761581421 0.8999999761581421 0.8999999761581421" + valueHighPrecision = FALSE + plane = "0 0 1 0.5" + } + internalFields = "" +} +module ConstantImage { + internal { + frame = "605 125 120 56" + moduleGroupName = "" + windows { + window _default { + geometry = "534 411 219 246" + sizeHint = "219 246" + wasOpen = no + wasActive = no + } + } + } + fields { + instanceName = ConstantImage + sizeX = 256 + sizeY = 256 + sizeZ = 1 + sizeC = 1 + sizeT = 1 + sizeU = 1 + dataType = float + fillValue = 0 + autoApply = TRUE + } +} +module CSOManager { + internal { + frame = "585 461 112 56" + moduleGroupName = "" + windows { + window _default { + geometry = "60 437 695 457" + sizeHint = "695 457" + wasOpen = no + wasActive = no + } + } + } + fields { + instanceName = CSOManager + workDirectlyOnInputCSOList = FALSE + selectLastCreatedGroup = TRUE + selectionColoringMode = SelectionColorModeFixed + selectionLineWidthMode = SelectionLineWidthWiden + selectionBrightenColor = 0.200000003 + selectionFixedColor = "1 1 0.6000000238418579" + selectionWidenLineWidth = 1 + selectionFixedLineWidth = 2 + csoDefaultLabel = "" + csoDefaultDescription = "" + csoDefaultShowState = TRUE + csoDefaultVoxelizeState = TRUE + csoDefaultEditableState = TRUE + groupSingleDeleteGroupCSOHandling = RemoveIfInNoGroup + groupDefaultLabel = "" + groupDefaultDescription = "" + groupDefaultLineStyle = LineStyleSolid + groupDefaultColor = "1 1 1" + groupDefaultAlpha = 1 + groupDefaultLineWidth = 1 + groupDefaultShowState = TRUE + groupDefaultVoxelizeState = TRUE + groupDefaultEditableState = TRUE + groupDefaultTimePointIndex = 0 + groupDefaultUseVisuals = FALSE + groupDefaultUseShowState = FALSE + groupDefaultUseVoxelizeState = FALSE + groupDefaultUseEditableState = FALSE + groupDefaultUseTimePointIndex = FALSE + groupDefaultUseVoxelWrite = FALSE + groupDefaultVoxelWriteMode = VoxelWriteModeModule + groupDefaultVoxelWriteValue = 1024 + groupDefaultUseMarkerSettings = FALSE + groupDefaultMarkerMode = MarkerModeRect + groupDefaultMarkerColor = "0 1 0" + groupDefaultMarkerAlpha = 1 + groupDefaultMarkerSize = 3 + groupDefaultNumMaximumCSOs = 0 + groupDefaultOverflowHandling = RemoveFirst + groupDefaultRemoveFromGroupHandling = RemoveIfInNoGroup + listSingleRemoveEmptyGroupHandling = RemoveAlways + listDefaultRemoveEmptyGroupHandling = RemoveAlways + numUndos = 13 + numRedos = 0 + undoStackLimit = 16 + useSelectionCSONotification = FALSE + useSelectionGroupNotification = FALSE + useFinishedCSONotification = FALSE + useFinishedGroupNotification = FALSE + useCSOMovedNotification = FALSE + useRepaintNotification = FALSE + useInteractionInitNotification = FALSE + useStartNewCSONotification = FALSE + enableSelectionNotification = TRUE + enableFinishedNotification = TRUE + enableCSOMovedNotification = TRUE + enableRepaintNotification = TRUE + csoTreeView = "" + groupTreeView = "" + numCSOs = 6 + numGroups = 0 + numSelectedCSOs = 1 + numSelectedGroups = 0 + selectedCSOsGroupIds = "" + csoTabSelected = FALSE + groupTabSelected = FALSE + selectionTabSelected = FALSE + notificationTabSelected = TRUE + defaultTabSelected = FALSE + csoCommonTabSelected = TRUE + csoVisualsTabSelected = FALSE + groupCommonTabSelected = FALSE + groupVisualsTabSelected = FALSE + groupMiscTabSelected = FALSE + notificationControlTabSelected = TRUE + notificationOutputCSOTabSelected = FALSE + notificationOutputGroupTabSelected = FALSE + defaultCSOCommonTabSelected = FALSE + defaultGroupCommonTabSelected = FALSE + defaultGroupVisualsTabSelected = FALSE + defaultGroupMiscTabSelected = FALSE + } +} +module CSOPointsToXMarkers { + internal { + frame = "561 317 160 56" + moduleGroupName = "" + windows { + window _default { + geometry = "858 592 165 91" + sizeHint = "165 91" + wasOpen = yes + wasActive = no + } + } + } + fields { + instanceName = CSOPointsToXMarkers + listIndexFld = -1 + convertPathPoints = FALSE + outputCSONormals = TRUE + } +} +connections { + SoGroup.children = "SoView2DMarkerEditor.self SoView2DCSOEditor.self" + SoView2DMarkerEditor.inXMarkerList = CSOPointsToXMarkers.outputXMarkerList + SoView2DCSOEditor.inCSOList = CSOManager.outCSOList + SoView2DCSOEditor.inProcessor = CSOFreehandProcessor.outProcessorData + View2D.inImage = ConstantImage.output0 + View2D.inInvPreLUT = SoGroup.self + CSOPointsToXMarkers.inputCSOList = CSOManager.outCSOList +} +networkModel { + parentItems { + 0 { + MLABNetworkModelItem MLABNoteItem { + uniqueId = 23 + objectName = "" + parentUniqueId = 0 + frame = "339 24 200 200" + backgroundColor { + r = 252 + g = 242 + b = 2 + a = 255 + } + text = "Draw a CSO and it will be converted to an XMarkerList" + titleText = Comment + isCollapsed = False + } + } + } +} Added: trunk/Community/General/Modules/ML/MLCSOCommunityModules/CSOSetProperties/CSOSetProperties.py =================================================================== --- trunk/Community/General/Modules/ML/MLCSOCommunityModules/CSOSetProperties/CSOSetProperties.py (rev 0) +++ trunk/Community/General/Modules/ML/MLCSOCommunityModules/CSOSetProperties/CSOSetProperties.py 2010-03-05 11:21:23 UTC (rev 228) @@ -0,0 +1,54 @@ +#----------------------------------------------------------------------- +# +# Copyright (c) 2010, Biomedical Imaging Group Rotterdam (BIGR), +# Departments of Radiology and Medical Informatics, Erasmus MC. All rights reserved. + +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# * Neither the name of BIGR nor the names of its contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL BIGR BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, +# OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE +# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# +#---------------------------------------------------------------------------------- +# CSOSetProperties GUI definitions. +# +# \file CSOSetProperties.script +# \author Reinhard Hameeteman +# \date 2010-03-02 +# +#---------------------------------------------------------------------------------- + +from mevis import * + +def SetEnableState(event = None): + excludedFields = ['CSOClearSelectionFld','GroupClearSelectionFld'] + filter = ctx.control("filter") + name = filter.eventControl().getName() + if name not in excludedFields : + setName = 'set'+ name[:-3] + ctx.field( setName ).value = not ctx.field( setName ).boolValue() + return + + +#//# MeVis signature v1 +#//# key: MFowDQYJKoZIhvcNAQEBBQADSQAwRgJBALMoAKeDufSkjPLfaCUd7Ij4IgEsndoDH9mP+jpEXKnAczgkSCgtNyNEMyiLur8xV1zEN7f71aeTOVWVntbzpucCARE=:lD+X/cPXp4xBkg/BH8EhyVWLOXzUCvL/ccrRKrYcyKMt2wR4QiXj1OCsqQukghRS1dwd5fRaB39vHgPZUYpdyA== +#//# owner: EMC +#//# date: 2010-03-02T15:15:35 +#//# hash: GPCQuNrO38gzKP73viu5TNs71mKHjFdYR5Yxtd2/oHtAUxoL10k8HhEYhjT672GKYYWsOl/rb+Lyqly69S5aLg== +#//# MeVis end Added: trunk/Community/General/Modules/ML/MLCSOCommunityModules/CSOSetProperties/CSOSetProperties.script =================================================================== --- trunk/Community/General/Modules/ML/MLCSOCommunityModules/CSOSetProperties/CSOSetProperties.script (rev 0) +++ trunk/Community/General/Modules/ML/MLCSOCommunityModules/CSOSetProperties/CSOSetProperties.script 2010-03-05 11:21:23 UTC (rev 228) @@ -0,0 +1,214 @@ +// Copyright (c) 2010, Biomedical Imaging Group Rotterdam (BIGR), +// Departments of Radiology and Medical Informatics, Erasmus MC. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// * Neither the name of BIGR nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL BIGR BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, +// OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE +// OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +//---------------------------------------------------------------------------------- +//! CSOSetProperties GUI definitions. +/*! +// \file CSOSetProperties.script +// \author Reinhard Hameeteman +// \date 2010-03-02 +*/ +//---------------------------------------------------------------------------------- + +Interface { + Parameters { + Field settingsTabOn { type = bool value = false } + } +} + +Description { + Field CSOAlpha { min = 0 max = 1 } + Field CSOLineWidth { min = 1 max = 16 } + Field CSOMarkerAlpha { min = 0 max = 1 } + Field GroupAlpha { min = 0 max = 1 } + Field GroupLineWidth { min = 1 max = 16 } + Field GroupMarkerAlpha { min = 0 max = 1 } + +} // description + +Commands { + source = $(LOCAL)/CSOSetProperties.py +} +Window { + maxw = 600 + name = mainWindow + EventFilter { + command = SetEnableState + filter = MouseButtonDblClick + control = CSOTab + control = GroupTab + children = Yes + eatEvent = Yes + name = filter + } + TabView { + style { + Prototype Vertical {expandY = yes} + Prototype Horizontal {expandY = yes} + Prototype TabViewItem {expandY = yes} + Prototype Box {expandY = yes} + } + TabViewItem "Main" { + Box "Input" { + ButtonBar inputMode { show = Radio } + tooltip = "Use -1 for all Ids" + Field inputCSOString { title = "CSO Ids:" expandX = YES visibleOn = "*inputMode == "CSO" *" } + Field inputGroupString { title = "Group Ids:" expandX = YES visibleOn = "*inputMode == "Group" *" } + } + + Box "Handle Notifications" { + CheckBox listenToFinishingNotifications { title = "Finishing" } + CheckBox listenToSelectionNotifications { title = "Selection" } + } + + Box "Operation Mode" { + Horizontal { + alignX = Left + CheckBox autoUpdate {} + Button update {} + } // horizontal + CheckBox workDirectlyOnInputList { title = "Work On Input List"} + } + Box { + Label { + title = "The properties of the CSO's that need to be set, can be enabled in the CSO and Group tab by double clicking on the field." + textWrap = WordBreak + } + } + + } // Vertical main + TabViewItem CSO { + name = CSOTab + expandY = Yes + Horizontal { + Vertical { + tooltip = "Double click on a field to enable it" + expandX = No + Box "Common" { + Field CSOLabel { name = CSOLabelFld dependsOn = setCSOLabel title = "Label:" alignGroupX = csog1 } + Field CSODescription { name = CSODescriptionFld dependsOn = setCSODescription title = "Description:" alignGroupX = csog1 } + Field CSOTimePointIndex { name = CSOTimePointIndexFld dependsOn = setCSOTimePointIndex title = "Time Point:" alignGroupX = csog1 step = 1 } + Horizontal { + CheckBox CSOIsSelected { name = CSOIsSelectedFld dependsOn = setCSOIsSelected title = "Is selected" alignGroupX = csog1 } + CheckBox CSOClearSelection { name = CSOClearSelectionFld dependsOn = setCSOIsSelected title = "Clear first" alignGroupX = csog2 } + } + Horizontal { + CheckBox CSOShowState { name = CSOShowStateFld dependsOn = setCSOShowState title = "Show" alignGroupX = csog1 } + CheckBox CSOEditableState { name = CSOEditableStateFld dependsOn = setCSOEditableState title = "Editable" alignGroupX = csog2 } + } + Horizontal { + CheckBox CSOVoxelizeState { name = CSOVoxelizeStateFld dependsOn = setCSOVoxelizeState title = "Voxelize" alignGroupX = csog1 } + CheckBox CSOComputeNormal { name = CSOComputeNormalFld dependsOn = setCSOComputeNormal title = recomputeNormal alignGroupX = csog2 } + } + } + Box "Voxelize" { + Field CSOVoxelWriteMode { name = CSOVoxelWriteModeFld dependsOn = setCSOVoxelWriteMode title = "Voxel Write Mode:" } + Field CSOVoxelWriteValue { name = CSOVoxelWriteValueFld dependsOn = setCSOVoxelWriteValue title = "Voxel Write Value:" } + } + } + Vertical { + Box "Path Points" { + Field CSOLineStyle { name = CSOLineStyleFld dependsOn = setCSOLineStyle title = "Style:"} + Field CSOLineWidth { name = CSOLineWidthFld dependsOn = setCSOLineWidth title = "Width:" step = 1 } + Field CSOColor { name = CSOColorFld dependsOn = setCSOColor title = "Color: "} + Field CSOAlpha { name = CSOAlphaFld dependsOn = setCSOAlpha title = "Alpha: " slider = YES step = 0.1 editField = NO } + } + Box "Markers" { + Field CSOMarkerMode { name = CSOMarkerModeFld dependsOn = setCSOMarkerMode title = "Mode:" } + Field CSOMarkerSize { name = CSOMarkerSizeFld dependsOn = setCSOMarkerSize title = "Size:" step = 0.5 } + Field CSOMarkerColor { name = CSOMarkerColorFld dependsOn = setCSOMarkerColor title = "Color: " } + Field CSOMarkerAlpha { name = CSOMarkerAlphaFld dependsOn = setCSOMarkerAlpha title = "Alpha: " slider = YES step = 0.1 editField = NO } + } + } + } // Horizontal + Horizontal {} + } // CSO + TabViewItem Group { + expandY = Yes + name = GroupTab + tooltip = "Double click on a field to enable it" + Horizontal { + Vertical { + Box "Common" { + Field GroupLabel { name = GroupLabelFld dependsOn = setGroupLabel title = "Label:" } + Field GroupDescription { name = GroupDescriptionFld dependsOn = setGroupDescription title = "Description:"} + Field GroupUseTimePointIndex { name = GroupUseTimePointIndexFld dependsOn = setGroupUseTimePointIndex title = "Use Time Point Index" } + Field GroupTimePointIndex { name = GroupTimePointIndexFld dependsOn = setGroupTimePointIndex title = "Time Point Index:" step = 1 } + Horizontal { + CheckBox GroupIsSelected { name = GroupIsSelectedFld dependsOn = setGroupIsSelected title = "Is selected" alignGroupX = gc1 } + CheckBox GroupClearSelection { name = GroupClearSelectionFld dependsOn = setGroupIsSelected title = "Clear first" alignGroupX = gc2 } + } + Horizontal { + CheckBox GroupUseShowState { name = GroupUseShowStateFld dependsOn = setGroupUseShowState title = "Use Show State" alignGroupX = gc1 } + CheckBox GroupShowState { name = GroupShowStateFld dependsOn = setGroupShowState title = "Show State" alignGroupX = gc2 } + } + Horizontal { + CheckBox GroupUseVoxelizeState { name = GroupUseVoxelizeStateFld dependsOn = setGroupUseVoxelizeState title = "Use Voxelize State" alignGroupX = gc1 } + CheckBox GroupVoxelizeState { name = GroupVoxelizeStateFld dependsOn = setGroupVoxelizeState title = "Voxelize State" alignGroupX = gc2 } + } + Horizontal { + CheckBox GroupUseEditableState { name = GroupUseEditableStateFld dependsOn = setGroupUseEditableState title = "Use Editable State" alignGroupX = gc1 } + CheckBox GroupEditableState { name = GroupEditableStateFld dependsOn = setGroupEditableState title = "Editable State" alignGroupX = gc2 } + } + } + Box "Rules" { + Field GroupMaximumNumCSOs { name = GroupMaximumNumCSOsFld dependsOn = setGroupMaximumNumCSOs title = "Maximum CSOs:" } + Field GroupOverflowHandling { name = GroupOverflowHandlingFld dependsOn = setGroupOverflowHandling title = "Overflow Handling:" } + Field GroupRemoveFromGroupHandling { name = GroupRemoveFromGroupHandlingFld dependsOn = setGroupRemoveFromGroupHandling title = "Remove CSO Handling:" } + Field GroupDeleteGroupCSOHandling { name = GroupDeleteGroupCSOHandlingFld dependsOn = setGroupDeleteGroupCSOHandling title = "Delete Group CSO Handling:" } + } + } + Vertical { + Box "Path Points" { + CheckBox GroupUseVisuals { name = GroupUseVisualsFld dependsOn = setGroupUseVisuals title = "Use Group Visuals" } + Field GroupLineStyle { name = GroupLineStyleFld dependsOn = setGroupLineStyle title = "Style:" } + Field GroupLineWidth { name = GroupLineWidthFld dependsOn = setGroupLineWidth title = "Width:" step = 1 } + Field GroupColor { name = GroupColorFld dependsOn = setGroupColor title = "Color:" } + Field GroupAlpha { name = GroupAlphaFld dependsOn = setGroupAlpha title = "Alpha:" slider = YES step = 0.1 editField = NO } + } + Box "Markers" { + CheckBox GroupUseMarkerSettings { name = GroupUseMarkerSettingsFld dependsOn = setGroupUseMarkerSettings title = "Use Marker Settings" } + Field GroupMarkerMode { name = GroupMarkerModeFld dependsOn = setGroupMarkerMode title = "Mode:" } + Field GroupMarkerSize { name = GroupMarkerSizeFld dependsOn = setGroupMarkerSize title = "Size:" step = 0.5 } + Field GroupMarkerColor { name = GroupMarkerColorFld dependsOn = setGroupMarkerColor title = "Color:" } + Field GroupMarkerAlpha { name = GroupMarkerAlphaFld dependsOn = setGroupMarkerAlpha title = "Alpha:" slider = YES step = 0.1 editField = NO } + } + Box "Voxelize" { + CheckBox GroupUseVoxelWrite { name = GroupUseVoxelWriteFld dependsOn = setGroupUseVoxelWrite title = "Use Voxel Write" } + Field GroupVoxelWriteMode { name = GroupVoxelWriteModeFld dependsOn = setGroupVoxelWriteMode title = "Voxel Write Mode: " } + Field GroupVoxelWriteValue { name = GroupVoxelWriteValueFld dependsOn = setGroupVoxelWriteValue title = "Voxel Write Value: " } + } + } + } + } + + } // TabView +} // window + +//# MeVis signature v1 +//# key: MFowDQYJKoZIhvcNAQEBBQADSQAwRgJBALMoAKeDufSkjPLfaCUd7Ij4IgEsndoDH9mP+jpEXKnAczgkSCgtNyNEMyiLur8xV1zEN7f71aeTOVWVntbzpucCARE=:lD+X/cPXp4xBkg/BH8EhyVWLOXzUCvL/ccrRKrYcyKMt2wR4QiXj1OCsqQukghRS1dwd5fRaB39vHgPZUYpdyA== +//# owner: EMC +//# date: 2010-03-02T15:17:20 +//# hash: aFxR8EoZL6PrO7+efbM4PBaaqDjgJauJpXeDjviQ9PkNpyjnzWs5X8fep3v35fXFSqX9sSHw5aePJhCyVYLbpw== +//# MeVis end Added: trunk/Community/General/Modules/ML/MLCSOCommunityModules/CSOSetProperties/CSOSetPropertiesExample.mlab =================================================================== --- trunk/Community/General/Modules/ML/MLCSOCommunityModules/CSOSetProperties/CSOSetPropertiesExample.mlab (rev 0) +++ trunk/Community/General/Modules/ML/MLCSOCommunityModules/CSOSetProperties/CSOSetPropertiesExample.mlab 2010-03-05 11:21:23 UTC (rev 228) @@ -0,0 +1,678 @@ +// MDL v1 utf8 +network { + watchlist = "" +} +module CSOInfo { + internal { + frame = "-195 29 88 56" + moduleGroupName = "Set Group properties" + windows { + window _default { + geometry = "584 174 522 581" + sizeHint = "347 581" + wasOpen = no + wasActive = no + } + } + } + fields { + instanceName = CSOInfo1 + csoShowPrivateValues = TRUE + groupId = 1 + groupUseShowState = FALSE + groupShowState = TRUE + groupUseVoxelizeState = FALSE + groupVoxelizeState = TRUE + groupUseEditableState = FALSE + groupEditableState = TRUE + shouldGenerateCSOStringOutput = TRUE + shouldGenerateCSOGroupStringOutput = FALSE + showCSOType = TRUE + showCSOSubType = TRUE + showCSOCreatorId = TRUE + showCSONumSeedPoints = TRUE + showCSONumPathPoints = TRUE + showCSOLength = FALSE + showCSOGrouping = TRUE + showCSOClosedState = TRUE + showCSOInPlane = TRUE + showGroupNumCSO = TRUE + showGroupCSOIds = TRUE + listenToRepaintNotifications = FALSE + listenToFinishingNotifications = TRUE + listenToSelectionChangedNotifications = TRUE + } +} +module LocalImage { + internal { + frame = "-295 405 96 56" + moduleGroupName = "" + } + fields { + instanceName = LocalImage + name = $(DemoDataPath)/Bone.tiff + trueName = "C:/Program Files/MeVisLab2.0VC9/Packages/MeVisLab/Resources/DemoData/Bone.tiff" + autoLoad = TRUE + status = "File open" + } + internalFields = "" +} +module View2D { + internal { + frame = "-379 29 120 56" + moduleGroupName = "Set Group properties" + windows { + window _default { + geometry = "188 481 400 400" + sizeHint = "400 400" + wasOpen = no + wasActive = no + } + } + } + fields { + instanceName = View2D + inventorInputOn = TRUE + view2DExtensionsOn = TRUE + startSlice = 42 + numSlices = 1 + numXSlices = 1 + sliceStep = 1 + slab = 1 + blendMode = BLEND_REPLACE + timePoint = 0 + maxTimePoint = 0 + filterMode = FILTER_LINEAR + standardKeys = TRUE + cineMode = CINE_Z + cineDirection = CINE_PINGPONG + cineRepeat = CINE_ONCE + cineSpeed = 0.1000000015 + snapToCenter = FALSE + zoomMode = VIEW2D_AUTO_ZOOM + unzoomOnImageChange = FALSE + sliceZoom = 1 + sliceZoomSynced = 1 + baseColor = "1 1 1" + margin = "2 2" + sliceOrigin = "0 0" + lutCenter = 2047.5 + lutWidth = 4095 + lutUseTraceColors = FALSE + annotationOn = TRUE + annotationMode = ANNO_MODE_AUTO + annotationSizeMode = ANNO_SHOW_DETAILED + annotationCol = "0.8999999761581421 0.8999999761581421 0.8999999761581421" + annotationFontSize = ANNO_SIZE_AUTO + annoCoords = Voxel + annoCTValue = AsIs + borderOn = TRUE + borderColor = "0.8999999761581421 0.8999999761581421 0.8999999761581421" + valueHighPrecision = FALSE + plane = "0 0 1 42.5" + } + internalFields = "" +} +module SoView2DCSOEditor { + internal { + frame = "-283 181 152 56" + moduleGroupName = "Set Group properties" + windows { + window _default { + geometry = "-44 19 558 465" + sizeHint = "558 465" + wasOpen = no + wasActive = no + } + } + } + fields { + instanceName = SoView2DCSOEditor + drawingOn = TRUE + editingOn = TRUE + maskValid = FALSE + fixZOn = TRUE + color = "1 1 1" + selectionTolerance = 24 + needsValidVoxel = TRUE + button1 = PRESSED + button2 = IGNORED + button3 = IGNORED + shift = IGNORED + control = IGNORED + alt = IGNORED + wantsAllEvents = TRUE + wantsKeyEvents = TRUE + wantsMouseWheelEvents = FALSE + setEventHandled = FALSE + ignoreHandledEvents = FALSE + createNewMode = FALSE + renderOnSlab = FALSE + clipToSlice = FALSE + cursorShape = UNDEFINED_CURSOR + shouldListenToRepaintEvents = TRUE + shouldListenToSelectionChangedEvents = TRUE + shouldListenToFinishedEvents = TRUE + generalInteractionMode = INTERACTION_MODE_EDIT + generalInteractionModeToggleKey = TOGGLE_MODE_ALT + useAntiAliasing = TRUE + useInterpolationTargetColor = TRUE + interpolationTargetColor = "1 0 0" + showBoundingBox = FALSE + boundingBoxAlpha = 0.5 + boundingBoxColor = "1 1 1" + showOnlyParallelCSOs = FALSE + showParallelDotProductLimitRadian = 0.9998999834 + shouldLevelCSO = FALSE + useStylePalette = FALSE + stylePaletteUseIndexAs = USE_INDEX_FOR_CSO + labelShowMode = LABEL_SHOW_GROUP_DESCRIPTION + labelAlignmentMode = LABEL_ALIGN_CENTER + labelUnitScale = LABEL_UNIT_SCALE_MM + showLabelUnits = TRUE + labelFontSize = 12 + labelUseTextShadow = TRUE + labelMarginX = 2 + labelMarginY = 2 + ghostMode = GHOST_BOTH_SIDES + ghostUnitMode = GHOST_UNIT_SLICE + ghostStyleAlpha = TRUE + ghostStyleStipple = TRUE + ghostStyleLineWidth = FALSE + ghostStyleBrighten = FALSE + ghostDepth = 5 + generalLabelColor = "1 1 1" + generalLabelAlpha = 1 + labelColorMode = COLOR_GENERAL + useTesselation = FALSE + tesselationColorMode = COLOR_AS_CSO + tesselationColor = "0.8999999761581421 0.5 0.8999999761581421"... [truncated message content] |
From: <rha...@us...> - 2010-03-05 11:18:45
|
Revision: 227 http://mevislabmodules.svn.sourceforge.net/mevislabmodules/?rev=227&view=rev Author: rhameeteman Date: 2010-03-05 11:18:38 +0000 (Fri, 05 Mar 2010) Log Message: ----------- KH. * Added file for group definitions and about messages. Added Paths: ----------- trunk/Community/General/Modules/Groups.def Added: trunk/Community/General/Modules/Groups.def =================================================================== --- trunk/Community/General/Modules/Groups.def (rev 0) +++ trunk/Community/General/Modules/Groups.def 2010-03-05 11:18:38 UTC (rev 227) @@ -0,0 +1,24 @@ +//----------------------------------------------------------------------------- +//! Group definitions +/*! +// \file Groups.def +// \author Reinhard Hameeteman +// \date 02/2010 +*/ +//----------------------------------------------------------------------------- + +MeVisAboutExtension = "* +<h3>BIGR Package Installed</h3><p> +<a href="http://www.bigr.nl/">BIGR</a><br> +<em>Copyright © 2010 Biomedical Imaging Group Rotterdam (BIGR)</em>,<br/> +Departments of Radiology and Medical Informatics, Erasmus MC,<br/> +University Medical Center, Rotterdam, The Netherlands. +*" + +ModuleGroup BIGR { + owner = "Biomedical Imaging Group Rotterdam, BIGR, Departments of Radiology and Medical Informatics, Erasmus MC University Medical Center, Rotterdam, The Netherlands" + title = "BIGR Modules" + comment = "Internally developed modules of BIGR" + type = std + shy = false +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <flo...@us...> - 2010-01-20 16:04:09
|
Revision: 226 http://mevislabmodules.svn.sourceforge.net/mevislabmodules/?rev=226&view=rev Author: florianlink Date: 2010-01-20 16:04:02 +0000 (Wed, 20 Jan 2010) Log Message: ----------- adding missing TEMPLATE = lib declarations for a future Qt update Modified Paths: -------------- trunk/Community/General/Sources/ML/CVLAscendingAortaDetection/CVLAscendingAortaDetection.pro trunk/Community/General/Sources/ML/MLBarcode/MLBarcode.pro trunk/Community/General/Sources/ML/MLCSOCommunityModules/MLCSOCommunityModules.pro trunk/Community/General/Sources/ML/MLWEMCommunityModules/MLWEMCommunityModules.pro trunk/UMD/METK/Sources/ML/kAviWriter/MLkAviWriter.pro Modified: trunk/Community/General/Sources/ML/CVLAscendingAortaDetection/CVLAscendingAortaDetection.pro =================================================================== --- trunk/Community/General/Sources/ML/CVLAscendingAortaDetection/CVLAscendingAortaDetection.pro 2010-01-17 21:26:09 UTC (rev 225) +++ trunk/Community/General/Sources/ML/CVLAscendingAortaDetection/CVLAscendingAortaDetection.pro 2010-01-20 16:04:02 UTC (rev 226) @@ -4,6 +4,8 @@ # project CVLAscendingAortaDetection. # +TEMPLATE = lib + TARGET = CVLAscendingAortaDetection DESTDIR = ../../../lib Modified: trunk/Community/General/Sources/ML/MLBarcode/MLBarcode.pro =================================================================== --- trunk/Community/General/Sources/ML/MLBarcode/MLBarcode.pro 2010-01-17 21:26:09 UTC (rev 225) +++ trunk/Community/General/Sources/ML/MLBarcode/MLBarcode.pro 2010-01-20 16:04:02 UTC (rev 226) @@ -23,6 +23,8 @@ # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +TEMPLATE = lib + TARGET = MLBarcode DESTDIR = ../../../lib Modified: trunk/Community/General/Sources/ML/MLCSOCommunityModules/MLCSOCommunityModules.pro =================================================================== --- trunk/Community/General/Sources/ML/MLCSOCommunityModules/MLCSOCommunityModules.pro 2010-01-17 21:26:09 UTC (rev 225) +++ trunk/Community/General/Sources/ML/MLCSOCommunityModules/MLCSOCommunityModules.pro 2010-01-20 16:04:02 UTC (rev 226) @@ -7,6 +7,8 @@ # \date 05/2009 # ----------------------------------------------------------------------------- +TEMPLATE = lib + TARGET = MLCSOCommunityModules DESTDIR = ../../../lib Modified: trunk/Community/General/Sources/ML/MLWEMCommunityModules/MLWEMCommunityModules.pro =================================================================== --- trunk/Community/General/Sources/ML/MLWEMCommunityModules/MLWEMCommunityModules.pro 2010-01-17 21:26:09 UTC (rev 225) +++ trunk/Community/General/Sources/ML/MLWEMCommunityModules/MLWEMCommunityModules.pro 2010-01-20 16:04:02 UTC (rev 226) @@ -7,6 +7,8 @@ # \date 05/2009 # ----------------------------------------------------------------------------- +TEMPLATE = lib + TARGET = MLWEMCommunityModules DESTDIR = ../../../lib Modified: trunk/UMD/METK/Sources/ML/kAviWriter/MLkAviWriter.pro =================================================================== --- trunk/UMD/METK/Sources/ML/kAviWriter/MLkAviWriter.pro 2010-01-17 21:26:09 UTC (rev 225) +++ trunk/UMD/METK/Sources/ML/kAviWriter/MLkAviWriter.pro 2010-01-20 16:04:02 UTC (rev 226) @@ -8,6 +8,8 @@ # $Source$ # -------------------------------------------------- +TEMPLATE = lib + TARGET = MLkAviWriter DESTDIR = ../../../lib This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <awa...@us...> - 2010-01-17 21:26:23
|
Revision: 225 http://mevislabmodules.svn.sourceforge.net/mevislabmodules/?rev=225&view=rev Author: awakeideas Date: 2010-01-17 21:26:09 +0000 (Sun, 17 Jan 2010) Log Message: ----------- simplification Modified Paths: -------------- trunk/Community/General/Sources/ML/MLOsiriXImporter/MeVisLabHub/MeVisLabHub.pro Modified: trunk/Community/General/Sources/ML/MLOsiriXImporter/MeVisLabHub/MeVisLabHub.pro =================================================================== --- trunk/Community/General/Sources/ML/MLOsiriXImporter/MeVisLabHub/MeVisLabHub.pro 2010-01-14 15:21:13 UTC (rev 224) +++ trunk/Community/General/Sources/ML/MLOsiriXImporter/MeVisLabHub/MeVisLabHub.pro 2010-01-17 21:26:09 UTC (rev 225) @@ -1,10 +1,8 @@ # MeVisLabHub -macx { +macx:release:!debug { # build the plugin using xcodebuild - release:!debug:system(xcodebuild -configuration Development clean build) + system(xcodebuild -configuration Development clean build) - # the plugin will end up in 'build/Development' (MeVisLabHub.osirixplugin) - } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wc...@us...> - 2010-01-14 15:21:21
|
Revision: 224 http://mevislabmodules.svn.sourceforge.net/mevislabmodules/?rev=224&view=rev Author: wcl_sd Date: 2010-01-14 15:21:13 +0000 (Thu, 14 Jan 2010) Log Message: ----------- MeVisHub for OsiriX: bug fixing and adding User Guide and examples. Modified Paths: -------------- trunk/Community/General/Sources/ML/MLOsiriXImporter/MeVisLab2OsiriXTBridge.h trunk/Community/General/Sources/ML/MLOsiriXImporter/MeVisLab2OsiriXTBridge.mm trunk/Community/General/Sources/ML/MLOsiriXImporter/MeVisLabHub/MeVisHubGUI.xib trunk/Community/General/Sources/ML/MLOsiriXImporter/MeVisLabHub/MeVisHubWindowController.h trunk/Community/General/Sources/ML/MLOsiriXImporter/MeVisLabHub/MeVisHubWindowController.m trunk/Community/General/Sources/ML/MLOsiriXImporter/MeVisLabHub/MeVisOsiriXProxyProtocol.h trunk/Community/General/Sources/ML/MLOsiriXImporter/MeVisLabHub/OsiriX2MeVisLabTBridge.mm trunk/Community/General/Sources/ML/MLOsiriXImporter/MeVisOsiriXProxyProtocol.h trunk/Community/General/Sources/ML/MLOsiriXImporter/SharedImagesManager.mm trunk/Community/General/Sources/ML/MLOsiriXImporter/mlOsiriXImporter.mm Added Paths: ----------- trunk/Community/General/Sources/ML/MLOsiriXImporter/1 MeVisHub User Guide.pdf trunk/Community/General/Sources/ML/MLOsiriXImporter/10 Examples.zip Added: trunk/Community/General/Sources/ML/MLOsiriXImporter/1 MeVisHub User Guide.pdf =================================================================== (Binary files differ) Property changes on: trunk/Community/General/Sources/ML/MLOsiriXImporter/1 MeVisHub User Guide.pdf ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/Community/General/Sources/ML/MLOsiriXImporter/10 Examples.zip =================================================================== (Binary files differ) Property changes on: trunk/Community/General/Sources/ML/MLOsiriXImporter/10 Examples.zip ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Modified: trunk/Community/General/Sources/ML/MLOsiriXImporter/MeVisLab2OsiriXTBridge.h =================================================================== --- trunk/Community/General/Sources/ML/MLOsiriXImporter/MeVisLab2OsiriXTBridge.h 2010-01-10 15:21:26 UTC (rev 223) +++ trunk/Community/General/Sources/ML/MLOsiriXImporter/MeVisLab2OsiriXTBridge.h 2010-01-14 15:21:13 UTC (rev 224) @@ -24,7 +24,7 @@ id remoteObjectProxy; NSConnection* remoteConnection; BOOL ifSupportMemorySharing; - + NSAutoreleasePool *autoReleasePool; //different parts ml::OsiriXImporter* importerML; ml::OsiriXExporter* exporterML; Modified: trunk/Community/General/Sources/ML/MLOsiriXImporter/MeVisLab2OsiriXTBridge.mm =================================================================== --- trunk/Community/General/Sources/ML/MLOsiriXImporter/MeVisLab2OsiriXTBridge.mm 2010-01-10 15:21:26 UTC (rev 223) +++ trunk/Community/General/Sources/ML/MLOsiriXImporter/MeVisLab2OsiriXTBridge.mm 2010-01-14 15:21:13 UTC (rev 224) @@ -123,7 +123,7 @@ { - + //autoReleasePool = [[NSAutoreleasePool alloc] init]; outgoingConnectionRegisteredName=[registeredName copy]; [remoteObjectProxy setProtocolForProxy:@protocol(MeVisOsiriXProxyProtocol)]; @@ -173,8 +173,10 @@ { [remoteObjectProxy release]; remoteObjectProxy=nil; +// [autoReleasePool release]; } remoteConnection=nil; + } #pragma mark- #pragma mark functions to interprete the operation request from OsiriX. @@ -183,9 +185,15 @@ NSString* operation=[request objectForKey:@"Operation"]; if(operation) { - if([operation isEqualToString:@"CallBack"]) + if([operation isEqualToString:@"SendMeImage"]) { NSMutableDictionary* parameters=[request objectForKey:@"Parameters"]; + NSString* description=[parameters objectForKey:@"ImageDescription"]; + [self prepareImageForUpperBridgeFromExporter:description]; + } + else if([operation isEqualToString:@"CallBack"]) + { + NSMutableDictionary* parameters=[request objectForKey:@"Parameters"]; NSString* registeredName=[parameters objectForKey:@"RegisteredName"]; NSNumber* supportSharedMem=[parameters objectForKey:@"SupportSharedMem"]; ifSupportMemorySharing=[supportSharedMem boolValue]; @@ -213,10 +221,22 @@ } return; } -- (NSDictionary*)getImage:(NSString*)description +//- (NSDictionary*)getImage:(NSString*)description +//{ +// NSLog([NSString stringWithFormat:@"MeVisLab: OsiriX is asking for:%@", description] ); +// return [self prepareImageForUpperBridgeFromExporter:description]; +//} +- (void)setImage:(NSDictionary*)anImage ForDescription:(NSString*) description { - NSLog([NSString stringWithFormat:@"MeVisLab: OsiriX is asking for:%@", description] ); - return [self prepareImageForUpperBridgeFromExporter:description]; + if(anImage) + { + NSMutableDictionary*anNewImage=[anImage mutableCopy]; + [imagesManager creatASharedImage:anNewImage ForDescription:description SupportSharedMem:ifSupportMemorySharing]; + NSLog([NSString stringWithFormat:@"MeVisLab: %@ received", description] ); + [anNewImage release]; + + } + } #pragma mark- #pragma mark functions when works as a bridge between Importer and OsiriX. @@ -231,15 +251,23 @@ } } NSLog([NSString stringWithFormat:@"MeVisLab: MeVisLab is asking for:%@", description] ); - NSDictionary* anImage=[remoteObjectProxy getImage:description]; - if(anImage) + //NSDictionary* anImage=[remoteObjectProxy getImage:description]; + NSMutableDictionary* anoperation=[NSMutableDictionary dictionaryWithCapacity:0]; { - NSMutableDictionary*anNewImage=[anImage mutableCopy]; - [imagesManager creatASharedImage:anNewImage ForDescription:description SupportSharedMem:ifSupportMemorySharing]; - NSLog([NSString stringWithFormat:@"MeVisLab: %@ received", description] ); - [anNewImage release]; - + NSString* operation=[NSString stringWithString:@"SendMeImage"]; + NSMutableDictionary* parameters=[NSMutableDictionary dictionaryWithCapacity:0]; + { + [parameters setObject:description forKey:@"ImageDescription"]; + } + NSMutableArray* relatedImages=[NSMutableArray arrayWithCapacity:0]; + + [anoperation setObject:operation forKey:@"Operation"]; + [anoperation setObject:parameters forKey:@"Parameters"]; + [anoperation setObject:relatedImages forKey:@"RelatedImages"]; } + + [remoteObjectProxy setOperation:anoperation]; + return [imagesManager getImageForDescription: description]; } -(void)passingOnNotificationsToImporter:(NSDictionary*)parameters @@ -300,22 +328,31 @@ return nil; } NSMutableDictionary* savedImage=[imagesManager getImageForDescription: description]; - - if((![description isEqualToString:@"OutputImage2"])&&savedImage&&[[savedImage objectForKey:@"MemSize"] longValue]==[[tempImage objectForKey:@"MemSize"] longValue]) + if(![description isEqualToString:@"OutputImage2"]) { - [savedImage setObject:[tempImage objectForKey:@"Dimension"] forKey:@"Dimension"]; - [savedImage setObject:[tempImage objectForKey:@"Spacing"] forKey:@"Spacing"]; - [savedImage setObject:[tempImage objectForKey:@"MatrixToPatientCo"] forKey:@"MatrixToPatientCo"]; - [savedImage setObject:[tempImage objectForKey:@"Maximum"] forKey:@"Maximum"]; - [savedImage setObject:[tempImage objectForKey:@"Minimum"] forKey:@"Minimum"]; + if(savedImage&&[[savedImage objectForKey:@"MemSize"] longValue]==[[tempImage objectForKey:@"MemSize"] longValue]) + { + [savedImage setObject:[tempImage objectForKey:@"Dimension"] forKey:@"Dimension"]; + [savedImage setObject:[tempImage objectForKey:@"Spacing"] forKey:@"Spacing"]; + [savedImage setObject:[tempImage objectForKey:@"MatrixToPatientCo"] forKey:@"MatrixToPatientCo"]; + [savedImage setObject:[tempImage objectForKey:@"Maximum"] forKey:@"Maximum"]; + [savedImage setObject:[tempImage objectForKey:@"Minimum"] forKey:@"Minimum"]; + } + else + { + [savedImage removeObjectForKey:@"Data"]; + if(![imagesManager creatASharedImage:tempImage ForDescription:description SupportSharedMem:ifSupportMemorySharing]) + { + //here the error message should be sent back to osirix + [imagesManager removeImage:savedImage]; + } + + } } - else - { - [imagesManager creatASharedImage:tempImage ForDescription:description SupportSharedMem:ifSupportMemorySharing]; - } [tempImage release]; NSMutableDictionary* resultImage=[imagesManager getImageForDescription: description]; + NSMutableDictionary* returnImage=nil; if(resultImage) { if([description isEqualToString:@"OutputImage0"]) @@ -327,14 +364,19 @@ exporterML->calcInSubImage(resultImage, 1); } - resultImage=[[resultImage mutableCopy] autorelease]; + + + returnImage=[resultImage mutableCopy]; if(ifSupportMemorySharing) - [resultImage removeObjectForKey:@"Data"]; + [returnImage removeObjectForKey:@"Data"]; + [remoteObjectProxy setImage: returnImage ForDescription: description]; + [returnImage release]; + } NSLog([NSString stringWithFormat:@"MeVisLab: MeVisLab is sending:%@", description] ); - return resultImage; + return [imagesManager getImageForDescription: description]; } -(void)passingOnNotificationsToUpperBridge:(NSDictionary*)parameters { Modified: trunk/Community/General/Sources/ML/MLOsiriXImporter/MeVisLabHub/MeVisHubGUI.xib =================================================================== --- trunk/Community/General/Sources/ML/MLOsiriXImporter/MeVisLabHub/MeVisHubGUI.xib 2010-01-10 15:21:26 UTC (rev 223) +++ trunk/Community/General/Sources/ML/MLOsiriXImporter/MeVisLabHub/MeVisHubGUI.xib 2010-01-14 15:21:13 UTC (rev 224) @@ -2,8 +2,8 @@ <archive type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="7.03"> <data> <int key="IBDocument.SystemTarget">1050</int> - <string key="IBDocument.SystemVersion">9L30</string> - <string key="IBDocument.InterfaceBuilderVersion">677</string> + <string key="IBDocument.SystemVersion">9L31a</string> + <string key="IBDocument.InterfaceBuilderVersion">680</string> <string key="IBDocument.AppKitVersion">949.54</string> <string key="IBDocument.HIToolboxVersion">353.00</string> <object class="NSMutableArray" key="IBDocument.EditedObjectIDs"> @@ -47,7 +47,7 @@ <nil key="NSViewClass"/> <string key="NSWindowContentMaxSize">{3.40282e+38, 3.40282e+38}</string> <object class="NSView" key="NSWindowView" id="996985436"> - <nil key="NSNextResponder"/> + <reference key="NSNextResponder"/> <int key="NSvFlags">256</int> <object class="NSMutableArray" key="NSSubviews"> <bool key="EncodedWithXMLCoder">YES</bool> @@ -56,6 +56,7 @@ <int key="NSvFlags">297</int> <string key="NSFrame">{{669, 453}, {96, 32}}</string> <reference key="NSSuperview" ref="996985436"/> + <reference key="NSWindow"/> <bool key="NSEnabled">YES</bool> <object class="NSButtonCell" key="NSCell" id="868542321"> <int key="NSCellFlags">67239424</int> @@ -80,6 +81,7 @@ <int key="NSvFlags">297</int> <string key="NSFrame">{{669, 421}, {96, 32}}</string> <reference key="NSSuperview" ref="996985436"/> + <reference key="NSWindow"/> <bool key="NSEnabled">YES</bool> <object class="NSButtonCell" key="NSCell" id="841461954"> <int key="NSCellFlags">67239424</int> @@ -100,6 +102,7 @@ <int key="NSvFlags">297</int> <string key="NSFrame">{{669, 389}, {96, 32}}</string> <reference key="NSSuperview" ref="996985436"/> + <reference key="NSWindow"/> <bool key="NSEnabled">YES</bool> <object class="NSButtonCell" key="NSCell" id="543929613"> <int key="NSCellFlags">-2080244224</int> @@ -120,6 +123,7 @@ <int key="NSvFlags">303</int> <string key="NSFrame">{{18, 352}, {355, 17}}</string> <reference key="NSSuperview" ref="996985436"/> + <reference key="NSWindow"/> <bool key="NSEnabled">YES</bool> <object class="NSSliderCell" key="NSCell" id="471963150"> <int key="NSCellFlags">-2079981824</int> @@ -146,6 +150,7 @@ <int key="NSvFlags">303</int> <string key="NSFrame">{{68, 416}, {115, 17}}</string> <reference key="NSSuperview" ref="996985436"/> + <reference key="NSWindow"/> <bool key="NSEnabled">YES</bool> <object class="NSSliderCell" key="NSCell" id="77973335"> <int key="NSCellFlags">-2079981824</int> @@ -168,6 +173,7 @@ <int key="NSvFlags">303</int> <string key="NSFrame">{{404, 352}, {355, 17}}</string> <reference key="NSSuperview" ref="996985436"/> + <reference key="NSWindow"/> <bool key="NSEnabled">YES</bool> <object class="NSSliderCell" key="NSCell" id="524657236"> <int key="NSCellFlags">-2079981824</int> @@ -190,6 +196,7 @@ <int key="NSvFlags">303</int> <string key="NSFrame">{{15, 416}, {58, 17}}</string> <reference key="NSSuperview" ref="996985436"/> + <reference key="NSWindow"/> <bool key="NSEnabled">YES</bool> <object class="NSTextFieldCell" key="NSCell" id="580941129"> <int key="NSCellFlags">68288064</int> @@ -222,6 +229,7 @@ <int key="NSvFlags">303</int> <string key="NSFrame">{{15, 396}, {58, 17}}</string> <reference key="NSSuperview" ref="996985436"/> + <reference key="NSWindow"/> <bool key="NSEnabled">YES</bool> <object class="NSTextFieldCell" key="NSCell" id="263673420"> <int key="NSCellFlags">68288064</int> @@ -238,6 +246,7 @@ <int key="NSvFlags">303</int> <string key="NSFrame">{{244, 416}, {58, 17}}</string> <reference key="NSSuperview" ref="996985436"/> + <reference key="NSWindow"/> <bool key="NSEnabled">YES</bool> <object class="NSTextFieldCell" key="NSCell" id="154753079"> <int key="NSCellFlags">68288064</int> @@ -254,6 +263,7 @@ <int key="NSvFlags">303</int> <string key="NSFrame">{{244, 396}, {58, 17}}</string> <reference key="NSSuperview" ref="996985436"/> + <reference key="NSWindow"/> <bool key="NSEnabled">YES</bool> <object class="NSTextFieldCell" key="NSCell" id="122711045"> <int key="NSCellFlags">68288064</int> @@ -270,6 +280,7 @@ <int key="NSvFlags">303</int> <string key="NSFrame">{{458, 416}, {58, 17}}</string> <reference key="NSSuperview" ref="996985436"/> + <reference key="NSWindow"/> <bool key="NSEnabled">YES</bool> <object class="NSTextFieldCell" key="NSCell" id="445612229"> <int key="NSCellFlags">68288064</int> @@ -286,6 +297,7 @@ <int key="NSvFlags">303</int> <string key="NSFrame">{{458, 396}, {58, 17}}</string> <reference key="NSSuperview" ref="996985436"/> + <reference key="NSWindow"/> <bool key="NSEnabled">YES</bool> <object class="NSTextFieldCell" key="NSCell" id="213090265"> <int key="NSCellFlags">68288064</int> @@ -302,6 +314,7 @@ <int key="NSvFlags">315</int> <string key="NSFrame">{{404, 449}, {254, 46}}</string> <reference key="NSSuperview" ref="996985436"/> + <reference key="NSWindow"/> <bool key="NSEnabled">YES</bool> <object class="NSTextFieldCell" key="NSCell" id="217814428"> <int key="NSCellFlags">75628032</int> @@ -322,6 +335,7 @@ <int key="NSvFlags">303</int> <string key="NSFrame">{{191, 416}, {41, 22}}</string> <reference key="NSSuperview" ref="996985436"/> + <reference key="NSWindow"/> <bool key="NSEnabled">YES</bool> <object class="NSTextFieldCell" key="NSCell" id="523621866"> <int key="NSCellFlags">-1804468671</int> @@ -352,6 +366,7 @@ <int key="NSvFlags">303</int> <string key="NSFrame">{{68, 391}, {115, 17}}</string> <reference key="NSSuperview" ref="996985436"/> + <reference key="NSWindow"/> <int key="NSTag">3</int> <bool key="NSEnabled">YES</bool> <object class="NSSliderCell" key="NSCell" id="641199605"> @@ -375,6 +390,7 @@ <int key="NSvFlags">303</int> <string key="NSFrame">{{191, 391}, {41, 22}}</string> <reference key="NSSuperview" ref="996985436"/> + <reference key="NSWindow"/> <int key="NSTag">3</int> <bool key="NSEnabled">YES</bool> <object class="NSTextFieldCell" key="NSCell" id="257188581"> @@ -393,6 +409,7 @@ <int key="NSvFlags">303</int> <string key="NSFrame">{{289, 391}, {115, 17}}</string> <reference key="NSSuperview" ref="996985436"/> + <reference key="NSWindow"/> <int key="NSTag">4</int> <bool key="NSEnabled">YES</bool> <object class="NSSliderCell" key="NSCell" id="456784044"> @@ -416,6 +433,7 @@ <int key="NSvFlags">303</int> <string key="NSFrame">{{412, 391}, {41, 22}}</string> <reference key="NSSuperview" ref="996985436"/> + <reference key="NSWindow"/> <int key="NSTag">4</int> <bool key="NSEnabled">YES</bool> <object class="NSTextFieldCell" key="NSCell" id="494605495"> @@ -434,6 +452,7 @@ <int key="NSvFlags">303</int> <string key="NSFrame">{{499, 391}, {115, 17}}</string> <reference key="NSSuperview" ref="996985436"/> + <reference key="NSWindow"/> <int key="NSTag">5</int> <bool key="NSEnabled">YES</bool> <object class="NSSliderCell" key="NSCell" id="679370761"> @@ -457,6 +476,7 @@ <int key="NSvFlags">303</int> <string key="NSFrame">{{622, 391}, {41, 22}}</string> <reference key="NSSuperview" ref="996985436"/> + <reference key="NSWindow"/> <int key="NSTag">5</int> <bool key="NSEnabled">YES</bool> <object class="NSTextFieldCell" key="NSCell" id="661535805"> @@ -475,6 +495,7 @@ <int key="NSvFlags">319</int> <string key="NSFrame">{{18, 20}, {355, 324}}</string> <reference key="NSSuperview" ref="996985436"/> + <reference key="NSWindow"/> <string key="NSClassName">CMIVDCMView</string> </object> <object class="NSCustomView" id="604689374"> @@ -482,6 +503,7 @@ <int key="NSvFlags">319</int> <string key="NSFrame">{{404, 20}, {355, 324}}</string> <reference key="NSSuperview" ref="996985436"/> + <reference key="NSWindow"/> <string key="NSClassName">CMIVDCMView</string> </object> <object class="NSSlider" id="545665219"> @@ -489,6 +511,7 @@ <int key="NSvFlags">303</int> <string key="NSFrame">{{289, 416}, {115, 17}}</string> <reference key="NSSuperview" ref="996985436"/> + <reference key="NSWindow"/> <int key="NSTag">1</int> <bool key="NSEnabled">YES</bool> <object class="NSSliderCell" key="NSCell" id="774467762"> @@ -512,6 +535,7 @@ <int key="NSvFlags">303</int> <string key="NSFrame">{{412, 416}, {41, 22}}</string> <reference key="NSSuperview" ref="996985436"/> + <reference key="NSWindow"/> <int key="NSTag">1</int> <bool key="NSEnabled">YES</bool> <object class="NSTextFieldCell" key="NSCell" id="271908051"> @@ -530,6 +554,7 @@ <int key="NSvFlags">303</int> <string key="NSFrame">{{499, 416}, {115, 17}}</string> <reference key="NSSuperview" ref="996985436"/> + <reference key="NSWindow"/> <int key="NSTag">2</int> <bool key="NSEnabled">YES</bool> <object class="NSSliderCell" key="NSCell" id="838558130"> @@ -553,6 +578,7 @@ <int key="NSvFlags">303</int> <string key="NSFrame">{{622, 416}, {41, 22}}</string> <reference key="NSSuperview" ref="996985436"/> + <reference key="NSWindow"/> <int key="NSTag">2</int> <bool key="NSEnabled">YES</bool> <object class="NSTextFieldCell" key="NSCell" id="917073580"> @@ -571,6 +597,7 @@ <int key="NSvFlags">268</int> <string key="NSFrame">{{8, 449}, {286, 46}}</string> <reference key="NSSuperview" ref="996985436"/> + <reference key="NSWindow"/> <bool key="NSEnabled">YES</bool> <int key="NSNumRows">1</int> <int key="NSNumCols">5</int> @@ -726,6 +753,8 @@ </object> </object> <string key="NSFrameSize">{782, 501}</string> + <reference key="NSSuperview"/> + <reference key="NSWindow"/> </object> <string key="NSScreenRect">{{0, 0}, {1280, 1002}}</string> <string key="NSMaxSize">{3.40282e+38, 3.40282e+38}</string> @@ -740,7 +769,7 @@ <nil key="NSViewClass"/> <string key="NSWindowContentMaxSize">{3.40282e+38, 3.40282e+38}</string> <object class="NSView" key="NSWindowView" id="1027675405"> - <reference key="NSNextResponder"/> + <nil key="NSNextResponder"/> <int key="NSvFlags">256</int> <object class="NSMutableArray" key="NSSubviews"> <bool key="EncodedWithXMLCoder">YES</bool> @@ -759,7 +788,6 @@ <int key="NSvFlags">268</int> <string key="NSFrame">{{13, 494}, {104, 17}}</string> <reference key="NSSuperview" ref="982661092"/> - <reference key="NSWindow"/> <bool key="NSEnabled">YES</bool> <object class="NSTextFieldCell" key="NSCell" id="704936909"> <int key="NSCellFlags">67239424</int> @@ -776,7 +804,6 @@ <int key="NSvFlags">268</int> <string key="NSFrame">{{13, 465}, {104, 17}}</string> <reference key="NSSuperview" ref="982661092"/> - <reference key="NSWindow"/> <bool key="NSEnabled">YES</bool> <object class="NSTextFieldCell" key="NSCell" id="280972079"> <int key="NSCellFlags">67239424</int> @@ -793,7 +820,6 @@ <int key="NSvFlags">268</int> <string key="NSFrame">{{14, 399}, {98, 17}}</string> <reference key="NSSuperview" ref="982661092"/> - <reference key="NSWindow"/> <bool key="NSEnabled">YES</bool> <object class="NSTextFieldCell" key="NSCell" id="886043747"> <int key="NSCellFlags">67239424</int> @@ -810,7 +836,6 @@ <int key="NSvFlags">303</int> <string key="NSFrame">{{127, 488}, {419, 22}}</string> <reference key="NSSuperview" ref="982661092"/> - <reference key="NSWindow"/> <bool key="NSEnabled">YES</bool> <object class="NSTextFieldCell" key="NSCell" id="272168500"> <int key="NSCellFlags">343014976</int> @@ -828,7 +853,6 @@ <int key="NSvFlags">268</int> <string key="NSFrame">{{5, 519}, {112, 17}}</string> <reference key="NSSuperview" ref="982661092"/> - <reference key="NSWindow"/> <bool key="NSEnabled">YES</bool> <object class="NSTextFieldCell" key="NSCell" id="980269952"> <int key="NSCellFlags">67239424</int> @@ -845,7 +869,6 @@ <int key="NSvFlags">266</int> <string key="NSFrame">{{127, 517}, {187, 22}}</string> <reference key="NSSuperview" ref="982661092"/> - <reference key="NSWindow"/> <bool key="NSEnabled">YES</bool> <object class="NSTextFieldCell" key="NSCell" id="335863412"> <int key="NSCellFlags">343014976</int> @@ -863,7 +886,6 @@ <int key="NSvFlags">268</int> <string key="NSFrame">{{548, 482}, {83, 32}}</string> <reference key="NSSuperview" ref="982661092"/> - <reference key="NSWindow"/> <bool key="NSEnabled">YES</bool> <object class="NSButtonCell" key="NSCell" id="971874492"> <int key="NSCellFlags">67239424</int> @@ -884,7 +906,6 @@ <int key="NSvFlags">268</int> <string key="NSFrame">{{127, 396}, {138, 18}}</string> <reference key="NSSuperview" ref="982661092"/> - <reference key="NSWindow"/> <bool key="NSEnabled">YES</bool> <int key="NSNumRows">1</int> <int key="NSNumCols">2</int> @@ -1067,7 +1088,6 @@ <int key="NSvFlags">257</int> <string key="NSFrame">{{398, -2}, {90, 32}}</string> <reference key="NSSuperview" ref="1020810615"/> - <reference key="NSWindow"/> <int key="NSTag">-1</int> <bool key="NSEnabled">YES</bool> <object class="NSButtonCell" key="NSCell" id="533058116"> @@ -1089,7 +1109,6 @@ <int key="NSvFlags">257</int> <string key="NSFrame">{{488, -2}, {90, 32}}</string> <reference key="NSSuperview" ref="1020810615"/> - <reference key="NSWindow"/> <int key="NSTag">-1</int> <bool key="NSEnabled">YES</bool> <object class="NSButtonCell" key="NSCell" id="872273893"> @@ -1121,14 +1140,12 @@ <int key="NSvFlags">256</int> <string key="NSFrameSize">{541, 100}</string> <reference key="NSSuperview" ref="248269985"/> - <reference key="NSWindow"/> <bool key="NSEnabled">YES</bool> <object class="NSTableHeaderView" key="NSHeaderView" id="269875735"> <reference key="NSNextResponder" ref="509461483"/> <int key="NSvFlags">256</int> <string key="NSFrameSize">{541, 17}</string> <reference key="NSSuperview" ref="509461483"/> - <reference key="NSWindow"/> <reference key="NSTableView" ref="154920836"/> </object> <object class="_NSCornerView" key="NSCornerView" id="524366895"> @@ -1136,7 +1153,6 @@ <int key="NSvFlags">256</int> <string key="NSFrame">{{542, 0}, {16, 17}}</string> <reference key="NSSuperview" ref="815595106"/> - <reference key="NSWindow"/> </object> <object class="NSMutableArray" key="NSTableColumns"> <bool key="EncodedWithXMLCoder">YES</bool> @@ -1594,7 +1610,6 @@ </object> <string key="NSFrame">{{1, 17}, {541, 100}}</string> <reference key="NSSuperview" ref="815595106"/> - <reference key="NSWindow"/> <reference key="NSNextKeyView" ref="154920836"/> <reference key="NSDocView" ref="154920836"/> <reference key="NSBGColor" ref="631745917"/> @@ -1605,7 +1620,6 @@ <int key="NSvFlags">256</int> <string key="NSFrame">{{542, 17}, {15, 100}}</string> <reference key="NSSuperview" ref="815595106"/> - <reference key="NSWindow"/> <reference key="NSTarget" ref="815595106"/> <string key="NSAction">_doScroller:</string> <double key="NSPercent">8.446602e-01</double> @@ -1615,7 +1629,6 @@ <int key="NSvFlags">256</int> <string key="NSFrame">{{1, 117}, {541, 15}}</string> <reference key="NSSuperview" ref="815595106"/> - <reference key="NSWindow"/> <int key="NSsFlags">1</int> <reference key="NSTarget" ref="815595106"/> <string key="NSAction">_doScroller:</string> @@ -1630,7 +1643,6 @@ </object> <string key="NSFrame">{{1, 0}, {541, 17}}</string> <reference key="NSSuperview" ref="815595106"/> - <reference key="NSWindow"/> <reference key="NSNextKeyView" ref="269875735"/> <reference key="NSDocView" ref="269875735"/> <reference key="NSBGColor" ref="631745917"/> @@ -1640,7 +1652,6 @@ </object> <string key="NSFrame">{{14, 30}, {558, 133}}</string> <reference key="NSSuperview" ref="1020810615"/> - <reference key="NSWindow"/> <reference key="NSNextKeyView" ref="248269985"/> <int key="NSsFlags">50</int> <reference key="NSVScroller" ref="264218514"/> @@ -1653,12 +1664,10 @@ </object> <string key="NSFrame">{{2, 2}, {586, 170}}</string> <reference key="NSSuperview" ref="709799150"/> - <reference key="NSWindow"/> </object> </object> <string key="NSFrame">{{10, 149}, {590, 187}}</string> <reference key="NSSuperview" ref="1070460728"/> - <reference key="NSWindow"/> <string key="NSOffsets">{0, 0}</string> <object class="NSTextFieldCell" key="NSTitleCell"> <int key="NSCellFlags">67239424</int> @@ -1696,7 +1705,6 @@ <int key="NSvFlags">257</int> <string key="NSFrame">{{401, -1}, {90, 32}}</string> <reference key="NSSuperview" ref="7298560"/> - <reference key="NSWindow"/> <int key="NSTag">-1</int> <bool key="NSEnabled">YES</bool> <object class="NSButtonCell" key="NSCell" id="50671173"> @@ -1718,7 +1726,6 @@ <int key="NSvFlags">257</int> <string key="NSFrame">{{491, -1}, {90, 32}}</string> <reference key="NSSuperview" ref="7298560"/> - <reference key="NSWindow"/> <int key="NSTag">-1</int> <bool key="NSEnabled">YES</bool> <object class="NSButtonCell" key="NSCell" id="643805265"> @@ -1750,14 +1757,12 @@ <int key="NSvFlags">256</int> <string key="NSFrameSize">{544, 65}</string> <reference key="NSSuperview" ref="997668256"/> - <reference key="NSWindow"/> <bool key="NSEnabled">YES</bool> <object class="NSTableHeaderView" key="NSHeaderView" id="602592387"> <reference key="NSNextResponder" ref="791469329"/> <int key="NSvFlags">256</int> <string key="NSFrameSize">{544, 17}</string> <reference key="NSSuperview" ref="791469329"/> - <reference key="NSWindow"/> <reference key="NSTableView" ref="87603344"/> </object> <object class="_NSCornerView" key="NSCornerView" id="297362808"> @@ -1765,7 +1770,6 @@ <int key="NSvFlags">256</int> <string key="NSFrame">{{545, 0}, {16, 17}}</string> <reference key="NSSuperview" ref="52013824"/> - <reference key="NSWindow"/> </object> <object class="NSMutableArray" key="NSTableColumns"> <bool key="EncodedWithXMLCoder">YES</bool> @@ -1982,7 +1986,7 @@ <reference key="NSTableView" ref="87603344"/> </object> <object class="NSTableColumn" id="36157426"> - <double key="NSWidth">9.300015e+01</double> + <double key="NSWidth">9.300017e+01</double> <double key="NSMinWidth">1.000000e+01</double> <double key="NSMaxWidth">3.402823e+38</double> <object class="NSTableHeaderCell" key="NSHeaderCell"> @@ -2028,7 +2032,6 @@ </object> <string key="NSFrame">{{1, 17}, {544, 65}}</string> <reference key="NSSuperview" ref="52013824"/> - <reference key="NSWindow"/> <reference key="NSNextKeyView" ref="87603344"/> <reference key="NSDocView" ref="87603344"/> <reference key="NSBGColor" ref="631745917"/> @@ -2039,7 +2042,6 @@ <int key="NSvFlags">256</int> <string key="NSFrame">{{545, 17}, {15, 65}}</string> <reference key="NSSuperview" ref="52013824"/> - <reference key="NSWindow"/> <reference key="NSTarget" ref="52013824"/> <string key="NSAction">_doScroller:</string> <double key="NSPercent">8.947368e-01</double> @@ -2049,7 +2051,6 @@ <int key="NSvFlags">256</int> <string key="NSFrame">{{1, 82}, {544, 15}}</string> <reference key="NSSuperview" ref="52013824"/> - <reference key="NSWindow"/> <int key="NSsFlags">1</int> <reference key="NSTarget" ref="52013824"/> <string key="NSAction">_doScroller:</string> @@ -2064,7 +2065,6 @@ </object> <string key="NSFrame">{{1, 0}, {544, 17}}</string> <reference key="NSSuperview" ref="52013824"/> - <reference key="NSWindow"/> <reference key="NSNextKeyView" ref="602592387"/> <reference key="NSDocView" ref="602592387"/> <reference key="NSBGColor" ref="631745917"/> @@ -2074,7 +2074,6 @@ </object> <string key="NSFrame">{{14, 27}, {561, 98}}</string> <reference key="NSSuperview" ref="7298560"/> - <reference key="NSWindow"/> <reference key="NSNextKeyView" ref="997668256"/> <int key="NSsFlags">50</int> <reference key="NSVScroller" ref="582323660"/> @@ -2087,12 +2086,10 @@ </object> <string key="NSFrame">{{2, 2}, {589, 121}}</string> <reference key="NSSuperview" ref="205537838"/> - <reference key="NSWindow"/> </object> </object> <string key="NSFrame">{{10, -1}, {593, 138}}</string> <reference key="NSSuperview" ref="1070460728"/> - <reference key="NSWindow"/> <string key="NSOffsets">{0, 0}</string> <object class="NSTextFieldCell" key="NSTitleCell"> <int key="NSCellFlags">67239424</int> @@ -2116,7 +2113,6 @@ <int key="NSvFlags">266</int> <string key="NSFrame">{{13, 342}, {411, 18}}</string> <reference key="NSSuperview" ref="1070460728"/> - <reference key="NSWindow"/> <int key="NSTag">-1</int> <bool key="NSEnabled">YES</bool> <object class="NSButtonCell" key="NSCell" id="183114318"> @@ -2139,7 +2135,6 @@ <int key="NSvFlags">266</int> <string key="NSFrame">{{13, 126}, {166, 18}}</string> <reference key="NSSuperview" ref="1070460728"/> - <reference key="NSWindow"/> <int key="NSTag">-1</int> <bool key="NSEnabled">YES</bool> <object class="NSButtonCell" key="NSCell" id="584388762"> @@ -2160,12 +2155,10 @@ </object> <string key="NSFrame">{{1, 1}, {610, 368}}</string> <reference key="NSSuperview" ref="968420748"/> - <reference key="NSWindow"/> </object> </object> <string key="NSFrame">{{4, 4}, {612, 384}}</string> <reference key="NSSuperview" ref="982661092"/> - <reference key="NSWindow"/> <string key="NSOffsets">{0, 0}</string> <object class="NSTextFieldCell" key="NSTitleCell"> <int key="NSCellFlags">67239424</int> @@ -2189,7 +2182,6 @@ <int key="NSvFlags">268</int> <string key="NSFrame">{{127, 432}, {419, 46}}</string> <reference key="NSSuperview" ref="982661092"/> - <reference key="NSWindow"/> <bool key="NSEnabled">YES</bool> <object class="NSTextFieldCell" key="NSCell" id="266811473"> <int key="NSCellFlags">-1805517311</int> @@ -2207,7 +2199,6 @@ <int key="NSvFlags">268</int> <string key="NSFrame">{{381, 394}, {189, 18}}</string> <reference key="NSSuperview" ref="982661092"/> - <reference key="NSWindow"/> <bool key="NSEnabled">YES</bool> <object class="NSButtonCell" key="NSCell" id="165892959"> <int key="NSCellFlags">-2080244224</int> @@ -2228,12 +2219,10 @@ </object> <string key="NSFrame">{{2, 2}, {631, 545}}</string> <reference key="NSSuperview" ref="174241144"/> - <reference key="NSWindow"/> </object> </object> <string key="NSFrame">{{189, 48}, {635, 562}}</string> <reference key="NSSuperview" ref="1027675405"/> - <reference key="NSWindow"/> <string key="NSOffsets">{0, 0}</string> <object class="NSTextFieldCell" key="NSTitleCell"> <int key="NSCellFlags">67239424</int> @@ -2257,7 +2246,6 @@ <int key="NSvFlags">293</int> <string key="NSFrame">{{13, 45}, {90, 32}}</string> <reference key="NSSuperview" ref="1027675405"/> - <reference key="NSWindow"/> <int key="NSTag">-1</int> <bool key="NSEnabled">YES</bool> <object class="NSButtonCell" key="NSCell" id="363932874"> @@ -2279,7 +2267,6 @@ <int key="NSvFlags">293</int> <string key="NSFrame">{{98, 45}, {90, 32}}</string> <reference key="NSSuperview" ref="1027675405"/> - <reference key="NSWindow"/> <int key="NSTag">-1</int> <bool key="NSEnabled">YES</bool> <object class="NSButtonCell" key="NSCell" id="414102104"> @@ -2311,14 +2298,12 @@ <int key="NSvFlags">256</int> <string key="NSFrameSize">{199, 464}</string> <reference key="NSSuperview" ref="704670326"/> - <reference key="NSWindow"/> <bool key="NSEnabled">YES</bool> <object class="NSTableHeaderView" key="NSHeaderView" id="248526349"> <reference key="NSNextResponder" ref="984687643"/> <int key="NSvFlags">256</int> <string key="NSFrameSize">{199, 17}</string> <reference key="NSSuperview" ref="984687643"/> - <reference key="NSWindow"/> <reference key="NSTableView" ref="1065346365"/> </object> <object class="_NSCornerView" key="NSCornerView" id="180821553"> @@ -2326,7 +2311,6 @@ <int key="NSvFlags">256</int> <string key="NSFrame">{{152, 0}, {16, 17}}</string> <reference key="NSSuperview" ref="1011743800"/> - <reference key="NSWindow"/> </object> <object class="NSMutableArray" key="NSTableColumns"> <bool key="EncodedWithXMLCoder">YES</bool> @@ -2397,7 +2381,6 @@ </object> <string key="NSFrame">{{1, 17}, {151, 464}}</string> <reference key="NSSuperview" ref="1011743800"/> - <reference key="NSWindow"/> <reference key="NSNextKeyView" ref="1065346365"/> <reference key="NSDocView" ref="1065346365"/> <reference key="NSBGColor" ref="631745917"/> @@ -2408,7 +2391,6 @@ <int key="NSvFlags">256</int> <string key="NSFrame">{{152, 17}, {15, 464}}</string> <reference key="NSSuperview" ref="1011743800"/> - <reference key="NSWindow"/> <reference key="NSTarget" ref="1011743800"/> <string key="NSAction">_doScroller:</string> <double key="NSPercent">8.446602e-01</double> @@ -2418,7 +2400,6 @@ <int key="NSvFlags">256</int> <string key="NSFrame">{{1, 481}, {151, 15}}</string> <reference key="NSSuperview" ref="1011743800"/> - <reference key="NSWindow"/> <bool key="NSEnabled">YES</bool> <int key="NSsFlags">1</int> <reference key="NSTarget" ref="1011743800"/> @@ -2434,7 +2415,6 @@ </object> <string key="NSFrame">{{1, 0}, {151, 17}}</string> <reference key="NSSuperview" ref="1011743800"/> - <reference key="NSWindow"/> <reference key="NSNextKeyView" ref="248526349"/> <reference key="NSDocView" ref="248526349"/> <reference key="NSBGColor" ref="631745917"/> @@ -2444,7 +2424,6 @@ </object> <string key="NSFrame">{{20, 99}, {168, 497}}</string> <reference key="NSSuperview" ref="1027675405"/> - <reference key="NSWindow"/> <reference key="NSNextKeyView" ref="704670326"/> <int key="NSsFlags">178</int> <reference key="NSVScroller" ref="515971435"/> @@ -2459,7 +2438,6 @@ <int key="NSvFlags">293</int> <string key="NSFrame">{{726, 12}, {96, 32}}</string> <reference key="NSSuperview" ref="1027675405"/> - <reference key="NSWindow"/> <bool key="NSEnabled">YES</bool> <object class="NSButtonCell" key="NSCell" id="61866554"> <int key="NSCellFlags">67239424</int> @@ -2480,7 +2458,6 @@ <int key="NSvFlags">293</int> <string key="NSFrame">{{612, 12}, {96, 32}}</string> <reference key="NSSuperview" ref="1027675405"/> - <reference key="NSWindow"/> <int key="NSTag">1</int> <bool key="NSEnabled">YES</bool> <object class="NSButtonCell" key="NSCell" id="543427229"> @@ -2502,7 +2479,6 @@ <int key="NSvFlags">268</int> <string key="NSFrame">{{18, 604}, {74, 13}}</string> <reference key="NSSuperview" ref="1027675405"/> - <reference key="NSWindow"/> <bool key="NSEnabled">YES</bool> <object class="NSTextFieldCell" key="NSCell" id="13560843"> <int key="NSCellFlags">68288064</int> @@ -2520,8 +2496,6 @@ </object> </object> <string key="NSFrameSize">{842, 620}</string> - <reference key="NSSuperview"/> - <reference key="NSWindow"/> </object> <string key="NSScreenRect">{{0, 0}, {1280, 1002}}</string> <string key="NSMaxSize">{3.40282e+38, 3.40282e+38}</string> @@ -3751,6 +3725,14 @@ </object> <int key="connectionID">1546</int> </object> + <object class="IBConnectionRecord"> + <object class="IBActionConnection" key="connection"> + <string key="label">exportResultImages:</string> + <reference key="source" ref="1021"/> + <reference key="destination" ref="674451560"/> + </object> + <int key="connectionID">1547</int> + </object> </object> <object class="IBMutableOrderedSet" key="objectRecords"> <object class="NSArray" key="orderedObjects"> @@ -5226,7 +5208,7 @@ </object> </object> <nil key="sourceID"/> - <int key="maxID">1546</int> + <int key="maxID">1547</int> </object> <object class="IBClassDescriber" key="IBDocument.Classes"> <object class="NSMutableArray" key="referencedPartialClassDescriptions"> @@ -5321,6 +5303,7 @@ <string>changeParameter:</string> <string>closeCurrentWindow:</string> <string>endWarningWindow:</string> + <string>exportResultImages:</string> <string>scrollImageSynchronically:</string> <string>updateOutputImage:</string> </object> @@ -5332,6 +5315,7 @@ <string>id</string> <string>id</string> <string>id</string> + <string>id</string> </object> </object> <object class="NSMutableDictionary" key="outlets"> Modified: trunk/Community/General/Sources/ML/MLOsiriXImporter/MeVisLabHub/MeVisHubWindowController.h =================================================================== --- trunk/Community/General/Sources/ML/MLOsiriXImporter/MeVisLabHub/MeVisHubWindowController.h 2010-01-10 15:21:26 UTC (rev 223) +++ trunk/Community/General/Sources/ML/MLOsiriXImporter/MeVisLabHub/MeVisHubWindowController.h 2010-01-14 15:21:13 UTC (rev 224) @@ -55,6 +55,7 @@ int currentSychronizeMode; float transformmatrix[16]; float outputTransformmatrix[16]; + int outputDimension[4]; BOOL updatingROI; BOOL changingParameters; BOOL ifOutputMask1Available; @@ -73,6 +74,7 @@ -(BOOL)prepareOutputImages; -(IBAction)scrollImageSynchronically:(id)sender; -(IBAction)changeParameter:(id)sender; +-(IBAction)exportResultImages:(id)sender; - (IBAction)changCurrentTool:(id)sender; - (void) roiAdded: (NSNotification*) note; Modified: trunk/Community/General/Sources/ML/MLOsiriXImporter/MeVisLabHub/MeVisHubWindowController.m =================================================================== --- trunk/Community/General/Sources/ML/MLOsiriXImporter/MeVisLabHub/MeVisHubWindowController.m 2010-01-10 15:21:26 UTC (rev 223) +++ trunk/Community/General/Sources/ML/MLOsiriXImporter/MeVisLabHub/MeVisHubWindowController.m 2010-01-14 15:21:13 UTC (rev 224) @@ -7,6 +7,7 @@ // #import "MeVisHubWindowController.h" +#include <Accelerate/Accelerate.h> #define SYNCMODE_ALLSAME 1 #define SYNCMODE_SAMEORIENTATION 2 #define SYNCMODE_NOSUPPORT 0 @@ -97,7 +98,9 @@ [inputImageView becomeFirstResponder]; [self showWindow:self]; [self initializeToolsBar:operationConfigDict]; - + outputDimension[0]=-1; + [outputImageView setDrawing:YES]; + [outputImageView setDCM:[NSArray array]:[NSArray array] :[NSArray array] :0 :'i' :NO]; if(![self initializeParameters:operationConfigDict]) { NSRunAlertPanel(@"Failed", @"Failed to intialize parameters in MeVisLab" ,nil, nil, nil); @@ -138,6 +141,70 @@ return; } +-(IBAction)exportResultImages:(id)sender +{ + int dimension[3]; + NSArray* pixList=[outputImageView dcmPixList]; + DCMPix* curPix=[pixList objectAtIndex:0]; + NSArray* resultROIList=[outputImageView dcmRoiList]; + dimension[0] = [curPix pwidth]; + dimension[1] = [curPix pheight]; + dimension[2] = [pixList count]; + long size=dimension[0]*dimension[1]*dimension[2]*sizeof(float); + void* volumePtr=malloc(size); + if(volumePtr) + { + void* outputVolumePtr=(void* ) [curPix fImage]; + memcpy(volumePtr, outputVolumePtr, size); + NSData* volumeData=[[NSData alloc] initWithBytesNoCopy:volumePtr length:size freeWhenDone:YES]; + ViewerController* new2DViewer=[ViewerController newWindow:[outputImageView dcmPixList] :[outputImageView dcmFilesList] :volumeData]; + [volumeData release]; + unsigned int i,j; + for(i=0;i<[pixList count];i++) + { + DCMPix* tempPix=[pixList objectAtIndex:i]; + [tempPix setfImage:(float*)(volumePtr+i*dimension[0]*dimension[1]*sizeof(float))]; + + } + if(new2DViewer&&ifOutputMask1Available) + { + ROI* tempROI; + RGBColor color; + NSString *roiName; + unsigned char *textureBuffer; + NSMutableArray *roiList= [new2DViewer roiList]; + + for(i=0;i<[roiList count];i++) + { + [self updateMasksForOutputView: i]; + for(j=0;j<[[resultROIList objectAtIndex: 0] count];j++) + { + + + tempROI = [[resultROIList objectAtIndex: 0] objectAtIndex:j]; + roiName = [tempROI name]; + textureBuffer=[tempROI textureBuffer]; + color= [tempROI rgbcolor]; + + ROI *newROI=[[ROI alloc] initWithTexture:textureBuffer textWidth:dimension[0] textHeight:dimension[0] textName:roiName positionX:0 positionY:0 spacingX:[curPix pixelSpacingY] spacingY:[curPix pixelSpacingY] imageOrigin:NSMakePoint( [curPix originX], [curPix originY])]; + textureBuffer=[newROI textureBuffer]; + *textureBuffer=0x00; + *(textureBuffer+dimension[0]*dimension[1]-1)=0x00; + [newROI reduceTextureIfPossible]; + + [newROI setColor:color]; + + [[roiList objectAtIndex: i] addObject: newROI]; + [newROI release]; + } + } + + } + } + else + NSRunAlertPanel(@"Failed", @"Failed to create new series, you may run out of memory." ,nil, nil, nil); + [self scrollImageSynchronically:outputImageSlider]; +} - (void)applicationWillResignActive:(NSNotification *)aNotification { [warningWindow setLevel:NSNormalWindowLevel]; @@ -326,10 +393,12 @@ long size=dimension[0]*dimension[1]*dimension[2]*dimension[3]*sizeof(float); NSData* volumeData=[osrixViewController volumeData]; [inputImage0 setObject:[NSNumber numberWithLong:size] forKey:@"MemSize"]; - [inputImage0 setObject:volumeData forKey:@"Data"]; + if(dimension[3]==1) + [inputImage0 setObject:volumeData forKey:@"Data"]; if(![bridgeExportToMeVisLab initializeAnImageForSharing:inputImage0]) return NO; + [inputImage0 release]; //Update Input View @@ -337,6 +406,19 @@ if(newData) { float* newDataPtr=(float*)[newData bytes]; + if(dimension[3]>1) + { + long size3d=dimension[0]*dimension[1]*dimension[2]*sizeof(float); + void* newVolumePt=(void*)newDataPtr; + for(i=0;i<dimension[3];i++) + { + + void* volumePt= [osrixViewController volumePtr: i]; + memcpy(newVolumePt+i*size3d, volumePt, size3d); + } + } + + NSMutableArray *newPixList = [NSMutableArray arrayWithCapacity: 0]; NSMutableArray *newDcmList = [NSMutableArray arrayWithCapacity: 0]; NSMutableArray *newROIList = [NSMutableArray arrayWithCapacity: 0]; @@ -1143,6 +1225,7 @@ int dimension[4]={0,0,0,0}; float spacing[4]={1.0,1.0,1.0,1.0}; int i; + BOOL isImageHasDifferentDimension=NO; for(i=0;i<16;i++) outputTransformmatrix[i]=0; outputTransformmatrix[0]=1; @@ -1155,6 +1238,7 @@ // 0,0,1,0, // 0,0,0,1}; NSMutableArray *inputPixList=[inputImageView dcmPixList]; + NSArray *inputDcmList=[inputImageView dcmFilesList]; NSMutableArray *newPixList=[NSMutableArray arrayWithCapacity: 0]; NSMutableArray *newDcmList=[NSMutableArray arrayWithCapacity: 0]; @@ -1162,6 +1246,8 @@ BOOL ifOutputImage1Available=NO; ifOutputMask1Available=NO; + [outputImageView setDrawing:NO]; + NSDictionary* outputImage1=[bridgeImportFromMeVisLab getImageFromLowerBridge:@"OutputImage0"]; if(outputImage1) { @@ -1169,10 +1255,14 @@ NSString* imgtypestr=[outputImage1 objectForKey:@"ImageType"]; if([imgtypestr isEqualToString:@"float"]) { - + NSArray* dimensionarray=[outputImage1 objectForKey:@"Dimension"]; for(i=0;i<4;i++) + { dimension[i]=[[dimensionarray objectAtIndex:i] intValue]; + if(outputDimension[i]!=dimension[i]) + isImageHasDifferentDimension=YES; + } NSArray* spacingarray=[outputImage1 objectForKey:@"Spacing"]; for(i=0;i<4;i++) @@ -1189,33 +1279,68 @@ vector[i+6]=outputTransformmatrix[i*4+2]/spacing[2]; } NSData *newData = [outputImage1 objectForKey:@"Data"]; - if(newData&&[newData length]) + int memsize=dimension[0]*dimension[1]*dimension[2]*dimension[3]*sizeof(float); + if(newData&&[newData length]>=memsize) { - ifOutputImage1Available=YES; - float* newDataPtr=(float*)[newData bytes]; - for( i = 0 ; i < dimension[2]; i ++) + if(isImageHasDifferentDimension) { - DCMPix *copyPix = [[inputPixList objectAtIndex: 0] copy]; - float origin[3]; - int j; - for(j=0;j<3;j++) - origin[j]=i*outputTransformmatrix[j*4+2]+outputTransformmatrix[j*4+3]; + ifOutputImage1Available=YES; + float* newDataPtr=(float*)[newData bytes]; + for( i = 0 ; i < dimension[2]; i ++) + { + DCMPix *copyPix = [[inputPixList objectAtIndex: 0] copy]; + float origin[3]; + int j; + for(j=0;j<3;j++) + origin[j]=i*outputTransformmatrix[j*4+2]+outputTransformmatrix[j*4+3]; + + [copyPix setPwidth: dimension[0]]; + [copyPix setPheight: dimension[1]]; + [copyPix setPixelSpacingX:spacing[0]]; + [copyPix setPixelSpacingY:spacing[1]]; + [copyPix setOrigin:origin]; + [copyPix setOrientation: vector]; + [copyPix setfImage: (float*) (newDataPtr + dimension[0]* dimension[1]* i)]; + [copyPix setTot: dimension[2]]; + [copyPix setFrameNo: 0]; + [copyPix setID: i]; + + [newPixList addObject: copyPix]; + [copyPix release]; + [newDcmList addObject: [inputDcmList objectAtIndex: 0]]; + } + for(i=0;i<4;i++) + { + + outputDimension[i]=dimension[i]; + } + } + else + { + ifOutputImage1Available=YES; + float* newDataPtr=(float*)[newData bytes]; + + NSMutableArray *outputPixList=[outputImageView dcmPixList]; + for( i = 0 ; i < dimension[2]; i ++) + { + DCMPix *copyPix = [outputPixList objectAtIndex: i]; + float origin[3]; + int j; + for(j=0;j<3;j++) + origin[j]=i*outputTransformmatrix[j*4+2]+outputTransformmatrix[j*4+3]; + + [copyPix setPixelSpacingX:spacing[0]]; + [copyPix setPixelSpacingY:spacing[1]]; + [copyPix setOrigin:origin]; + [copyPix setOrientation: vector]; + [copyPix setfImage: (float*) (newDataPtr + dimension[0]* dimension[1]* i)]; + + + + } - [copyPix setPwidth: dimension[0]]; - [copyPix setPheight: dimension[1]]; - [copyPix setPixelSpacingX:spacing[0]]; - [copyPix setPixelSpacingY:spacing[1]]; - [copyPix setOrigin:origin]; - [copyPix setOrientation: vector]; - [copyPix setfImage: (float*) (newDataPtr + dimension[0]* dimension[1]* i)]; - [copyPix setTot: dimension[2]]; - [copyPix setFrameNo: 0]; - [copyPix setID: i]; - - [newPixList addObject: copyPix]; - [copyPix release]; - [newDcmList addObject: [inputDcmList objectAtIndex: 0]]; } + } } @@ -1231,8 +1356,12 @@ NSArray* dimensionarray=[outputImage1 objectForKey:@"Dimension"]; for(i=0;i<4;i++) + { dimension[i]=[[dimensionarray objectAtIndex:i] intValue]; - + outputDimension[i]=-1; + + } + isImageHasDifferentDimension=YES; NSArray* spacingarray=[outputImage1 objectForKey:@"Spacing"]; for(i=0;i<4;i++) spacing[i]=[[spacingarray objectAtIndex:i] floatValue]; @@ -1244,27 +1373,37 @@ [newPixList addObjectsFromArray:inputPixList]; [newDcmList addObjectsFromArray:inputDcmList]; + - } unsigned j; for( j = 0; j < [newPixList count]; j++) { [newROIList addObject:[NSMutableArray arrayWithCapacity:0]]; } + if( isImageHasDifferentDimension) + { + [outputImageView setStringID: @"MeVisHubOutput"]; + [outputImageView setDCM:newPixList :newDcmList :newROIList :0 :'i' :YES]; + [outputImageView setDrawing:YES]; + [outputImageSlider setNumberOfTickMarks:[newPixList count]]; + [outputImageSlider setMaxValue:[newPixList count]-1]; + [outputImageSlider setIntValue:[newPixList count]/2]; + [outputImageView setIndexWithReset: [newPixList count]/2 :YES]; + [outputImageView setOrigin: NSMakePoint(0,0)]; + [outputImageView setCurrentTool:tWL]; + [outputImageView scaleToFit]; + } + else + { + float iwl, iww; + iww = [outputImageView curWW]; + iwl = [outputImageView curWL]; + [outputImageView setWLWW:iwl :iww]; + } + - [outputImageView setStringID: @"MeVisHubOutput"]; - [outputImageView setDCM:newPixList :newDcmList :newROIList :0 :'i' :YES]; - [outputImageView setDrawing:YES]; - [outputImageSlider setNumberOfTickMarks:[newPixList count]]; - [outputImageSlider setMaxValue:[newPixList count]-1]; - [outputImageSlider setIntValue:[newPixList count]/2]; - [outputImageView setIndexWithReset: [newPixList count]/2 :YES]; - [outputImageView setOrigin: NSMakePoint(0,0)]; - [outputImageView setCurrentTool:tWL]; - [outputImageView scaleToFit]; - //Output Mask 1 NSDictionary* outputMask1=[bridgeImportFromMeVisLab getImageFromLowerBridge:@"OutputImage1"]; outputMaskResult=outputMask1; @@ -1295,12 +1434,6 @@ } - currentSychronizeMode=[self checkSynchronizeMode]; - //Synchronize the two view - [inputImageSlider setIntValue:[inputImageView curImage]]; - [outputImageSlider setIntValue:[inputImageView curImage]]; - [outputImageView setIndex: [inputImageView curImage]]; - BOOL ifOuputCSOAvailable=NO; NSDictionary* outputCSO1=[bridgeImportFromMeVisLab getImageFromLowerBridge:@"OutputImage2"]; if(outputCSO1) @@ -1309,7 +1442,11 @@ ifOuputCSOAvailable=YES; [self updateOutputViewCSOROI:[outputCSO1 objectForKey:@"OverlayObjects"]]; } + + currentSychronizeMode=[self checkSynchronizeMode]; + [self scrollImageSynchronically:inputImageSlider]; + [outputImageView setDrawing:YES]; return (ifOutputMask1Available||ifOutputImage1Available||ifOuputCSOAvailable); } @@ -1620,90 +1757,98 @@ case 0: if(isInteger) { - [para0Slider setIntValue:[sender intValue]]; - [para0ValueTextField setIntValue:[sender intValue]]; - value=[para0ValueTextField intValue]; + value=[sender intValue]; + [para0Slider setIntValue:value]; + [para0ValueTextField setIntValue:value]; + } else { - [para0Slider setDoubleValue:[sender doubleValue]]; - [para0ValueTextField setDoubleValue:[sender doubleValue]]; - value=[para0ValueTextField doubleValue]; + value=[sender doubleValue]; + [para0Slider setDoubleValue:value]; + [para0ValueTextField setDoubleValue:value]; + } paraName=[para0NameTextField stringValue]; break; case 1: if(isInteger) { - [para1Slider setIntValue:[sender intValue]]; - [para1ValueTextField setIntValue:[sender intValue]]; - value=[para1ValueTextField intValue]; + value=[sender intValue]; + [para1Slider setIntValue:value]; + [para1ValueTextField setIntValue:value]; } else { - [para1Slider setDoubleValue:[sender doubleValue]]; - [para1ValueTextField setDoubleValue:[sender doubleValue]]; - value=[para1ValueTextField doubleValue]; + value=[sender doubleValue]; + [para1Slider setDoubleValue:value]; + [para1ValueTextField setDoubleValue:value]; } paraName=[para1NameTextField stringValue]; break; case 2: if(isInteger) { - [para2Slider setIntValue:[sender intValue]]; - [para2ValueTextField setIntValue:[sender intValue]]; - value=[para2ValueTextField intValue]; + value=[sender intValue]; + [para2Slider setIntValue:value]; + [para2ValueTextField setIntValue:value]; + } else { - [para2Slider setDoubleValue:[sender doubleValue]]; - [para2ValueTextField setDoubleValue:[sender doubleValue]]; - value=[para2ValueTextField doubleValue]; + value=[sender doubleValue]; + [para2Slider setDoubleValue:value]; + [para2ValueTextField setDoubleValue:value]; + } paraName=[para2NameTextField stringValue]; break; case 3: if(isInteger) { - [para3Slider setIntValue:[sender intValue]]; - [para3ValueTextField setIntValue:[sender intValue]]; - value=[para3ValueTextField intValue]; + value=[sender intValue]; + [para3Slider setIntValue:value]; + [para3ValueTextField setIntValue:value]; } else { - [para3Slider setDoubleValue:[sender doubleValue]]; - [para3ValueTextField setDoubleValue:[sender doubleValue]]; - value=[para3ValueTextField doubleValue]; + value=[sender doubleValue]; + [para3Slider setDoubleValue:value]; + [para3ValueTextField setDoubleValue:value]; + } paraName=[para3NameTextField stringValue]; break; case 4: if(isInteger) { - [para4Slider setIntValue:[sender intValue]]; - [para4ValueTextField setIntValue:[sender intValue]]; - value=[para4ValueTextField intValue]; + value=[sender intValue]; + [para4Slider setIntValue:value]; + [para4ValueTextField setIntValue:value]; + } else { - [para4Slider setDoubleValue:[sender doubleValue]]; - [para4ValueTextField setDoubleValue:[sender doubleValue]]; - value=[para4ValueTextField doubleValue]; + value=[sender doubleValue]; + [para4Slider setDoubleValue:value]; + [para4ValueTextField setDoubleValue:value]; + } paraName=[para4NameTextField stringValue]; break; case 5: if(isInteger) { - [para5Slider setIntValue:[sender intValue]]; - [para5ValueTextField setIntValue:[sender intValue]]; - value=[para5ValueTextField intValue]; + value... [truncated message content] |
From: <wc...@us...> - 2010-01-10 15:21:34
|
Revision: 223 http://mevislabmodules.svn.sourceforge.net/mevislabmodules/?rev=223&view=rev Author: wcl_sd Date: 2010-01-10 15:21:26 +0000 (Sun, 10 Jan 2010) Log Message: ----------- support remote processing, in local network. Using Bonjour like Port Name registeration. The operation Name has to be unique in the network. Modified Paths: -------------- trunk/Community/General/Sources/ML/MLOsiriXImporter/MLOsiriXImporter.pro trunk/Community/General/Sources/ML/MLOsiriXImporter/MeVisLab2OsiriXTBridge.h trunk/Community/General/Sources/ML/MLOsiriXImporter/MeVisLab2OsiriXTBridge.mm trunk/Community/General/Sources/ML/MLOsiriXImporter/MeVisLabHub/MeVisHubGUI.xib trunk/Community/General/Sources/ML/MLOsiriXImporter/MeVisLabHub/MeVisHubWindowController.h trunk/Community/General/Sources/ML/MLOsiriXImporter/MeVisLabHub/MeVisHubWindowController.m trunk/Community/General/Sources/ML/MLOsiriXImporter/MeVisLabHub/MeVisLabHub.xcodeproj/project.pbxproj trunk/Community/General/Sources/ML/MLOsiriXImporter/MeVisLabHub/MeVisLabHubPref.xcdatamodel/elements trunk/Community/General/Sources/ML/MLOsiriXImporter/MeVisLabHub/MeVisLabHubPref.xcdatamodel/layout trunk/Community/General/Sources/ML/MLOsiriXImporter/MeVisLabHub/OsiriX Headers/ViewerController.h trunk/Community/General/Sources/ML/MLOsiriXImporter/MeVisLabHub/OsiriX2MeVisLabTBridge.h trunk/Community/General/Sources/ML/MLOsiriXImporter/MeVisLabHub/OsiriX2MeVisLabTBridge.mm trunk/Community/General/Sources/ML/MLOsiriXImporter/MeVisLabHub/SharedImagesManager.h trunk/Community/General/Sources/ML/MLOsiriXImporter/MeVisLabHub/SharedImagesManager.mm trunk/Community/General/Sources/ML/MLOsiriXImporter/SharedImagesManager.h trunk/Community/General/Sources/ML/MLOsiriXImporter/SharedImagesManager.mm trunk/Community/General/Sources/ML/MLOsiriXImporter/mlOsiriXExporter.h trunk/Community/General/Sources/ML/MLOsiriXImporter/mlOsiriXExporter.mm trunk/Community/General/Sources/ML/MLOsiriXImporter/mlOsiriXImporter.h trunk/Community/General/Sources/ML/MLOsiriXImporter/mlOsiriXImporter.mm Modified: trunk/Community/General/Sources/ML/MLOsiriXImporter/MLOsiriXImporter.pro =================================================================== --- trunk/Community/General/Sources/ML/MLOsiriXImporter/MLOsiriXImporter.pro 2009-12-15 14:15:11 UTC (rev 222) +++ trunk/Community/General/Sources/ML/MLOsiriXImporter/MLOsiriXImporter.pro 2010-01-10 15:21:26 UTC (rev 223) @@ -17,7 +17,7 @@ WARN = HIGH # add used projects here (see included pri files below for available projects) -CONFIG += dll ML MLBase +CONFIG += dll ML MLBase MLCSO MLCSOModules MLAB_PACKAGES += Community_General \ MeVisLab_Standard Modified: trunk/Community/General/Sources/ML/MLOsiriXImporter/MeVisLab2OsiriXTBridge.h =================================================================== --- trunk/Community/General/Sources/ML/MLOsiriXImporter/MeVisLab2OsiriXTBridge.h 2009-12-15 14:15:11 UTC (rev 222) +++ trunk/Community/General/Sources/ML/MLOsiriXImporter/MeVisLab2OsiriXTBridge.h 2010-01-10 15:21:26 UTC (rev 223) @@ -17,17 +17,20 @@ //common parts for OsiriX2MeVisLab and MeVisLab2OsiriX NSConnection *incomingConnection; NSString* incomingConnectionRegisteredName; + NSString* outgoingConnectionRegisteredName; + SharedImagesManager* imagesManager; id remoteObjectProxy; - + NSConnection* remoteConnection; + BOOL ifSupportMemorySharing; //different parts ml::OsiriXImporter* importerML; ml::OsiriXExporter* exporterML; } //common parts for OsiriX2MeVisLab and MeVisLab2OsiriX -- (id) initWithIncommingConnectionName:(NSString*)aname OutgoingConnection:(NSString*)bname; +- (id) initWithIncommingConnectionName:(NSString*)aname; - (BOOL)registerIncomingConnectionWithName:(NSString*)aname; - (BOOL)connectToRemoteObjectRegisteredAs:(NSString*)registeredName; - (void) connectionDidDie: (NSNotification *)notification; @@ -40,4 +43,5 @@ - (void) setExporterML:(ml::OsiriXExporter*) aML; - (void) passingOnNotificationsToImporter:(NSDictionary*)parameters; - (NSDictionary*)prepareImageForUpperBridgeFromExporter:(NSString*)description; + @end Modified: trunk/Community/General/Sources/ML/MLOsiriXImporter/MeVisLab2OsiriXTBridge.mm =================================================================== --- trunk/Community/General/Sources/ML/MLOsiriXImporter/MeVisLab2OsiriXTBridge.mm 2009-12-15 14:15:11 UTC (rev 222) +++ trunk/Community/General/Sources/ML/MLOsiriXImporter/MeVisLab2OsiriXTBridge.mm 2010-01-10 15:21:26 UTC (rev 223) @@ -7,25 +7,30 @@ // #import "MeVisLab2OsiriXTBridge.h" +#import <arpa/inet.h> - @implementation MeVisLab2OsiriXTBridge #pragma mark- #pragma mark functions to start build the message bridge -- (id) initWithIncommingConnectionName:(NSString*)aname OutgoingConnection:(NSString*)bname +- (id) initWithIncommingConnectionName:(NSString*)aname { self = [super init]; if (self) { imagesManager=[[SharedImagesManager alloc] initWithIDStringPrefix:@"MeVis"]; - outgoingConnectionRegisteredName=[bname copy]; + //outgoingConnectionRegisteredName=[bname copy];//outgoing name is not initialize any more, it will wait OsiriX call first. + outgoingConnectionRegisteredName=nil; + ifSupportMemorySharing=NO; // Vending services - if ((incomingConnection = [[NSConnection alloc] init])) { + NSSocketPort* port1=[[NSSocketPort alloc] init]; + + if ((incomingConnection = [[NSConnection alloc] initWithReceivePort:port1 sendPort:nil])){ + [incomingConnection setDelegate:self]; [incomingConnection setRootObject:self]; [incomingConnection setRequestTimeout:5]; [incomingConnection setReplyTimeout:30]; - if ([incomingConnection registerName:aname] == YES) { + if ([[NSSocketPortNameServer sharedInstance] registerPort:port1 name:aname] == YES) { std::cout << "Successfully registere service as " << [aname UTF8String] << std::endl; incomingConnectionRegisteredName=[aname copy]; } @@ -33,27 +38,47 @@ std::cout << "Cound not register service as " << [aname UTF8String] << std::endl; } } - + [port1 release]; } return self; } -(void)prepareToDealloc { - [[NSNotificationCenter defaultCenter] removeObserver: self];\ + if(remoteObjectProxy) + { + NSMutableDictionary* anoperation=[NSMutableDictionary dictionaryWithCapacity:0]; + { + NSString* operation=[NSString stringWithString:@"Breakup"]; + NSMutableDictionary* parameters=[NSMutableDictionary dictionaryWithCapacity:0]; + NSMutableArray* relatedImages=[NSMutableArray arrayWithCapacity:0]; + + [anoperation setObject:operation forKey:@"Operation"]; + [anoperation setObject:parameters forKey:@"Parameters"]; + [anoperation setObject:relatedImages forKey:@"RelatedImages"]; + } + + [remoteObjectProxy setOperation:anoperation]; + + } + [remoteConnection invalidate]; + [[NSNotificationCenter defaultCenter] removeObserver: self]; [[incomingConnection receivePort] invalidate];//this will work to unregister the NSConnection [[incomingConnection sendPort] invalidate]; [incomingConnection setRootObject:nil]; [incomingConnection registerName:nil];//this will not work as suggestion it alway return NO [incomingConnection invalidate]; [incomingConnection release]; + + if(incomingConnectionRegisteredName) + { + [[NSSocketPortNameServer sharedInstance] removePortForName:incomingConnectionRegisteredName]; + } incomingConnection = nil; } -(void)dealloc { [imagesManager release]; - if(remoteObjectProxy) - [remoteObjectProxy release]; - + [super dealloc]; } - (void) setImporterML:(ml::OsiriXImporter*) aML @@ -67,8 +92,12 @@ } - (BOOL)registerIncomingConnectionWithName:(NSString*)aname { - if ([incomingConnection registerName:aname] == YES) { + if ([[NSSocketPortNameServer sharedInstance] registerPort:[incomingConnection receivePort] name:aname] == YES) { std::cout << "Successfully registere service as " << [aname UTF8String] << std::endl; + if(incomingConnectionRegisteredName) + { + [[NSSocketPortNameServer sharedInstance] removePortForName:incomingConnectionRegisteredName]; + } incomingConnectionRegisteredName=[aname copy]; return YES; } @@ -77,13 +106,24 @@ return NO; } } -- (BOOL)connectToRemoteObjectRegisteredAs:(NSString*)registeredName +- (BOOL)connectToRemoteObjectRegisteredAs:(NSString*)registeredName { - remoteObjectProxy = [[NSConnection rootProxyForConnectionWithRegisteredName:registeredName host:nil] retain]; + if(!registeredName) + return NO; + NSSocketPort *port = (NSSocketPort *)[[NSSocketPortNameServer sharedInstance] + portForName:registeredName + host:@"*"]; + remoteConnection=[NSConnection connectionWithReceivePort:nil sendPort:port]; + if(remoteObjectProxy) + [remoteObjectProxy release]; + remoteObjectProxy = [[remoteConnection rootProxy] retain]; + if(remoteObjectProxy) { + + outgoingConnectionRegisteredName=[registeredName copy]; [remoteObjectProxy setProtocolForProxy:@protocol(MeVisOsiriXProxyProtocol)]; @@ -94,6 +134,10 @@ selector:@selector(connectionDidDie:) name:NSConnectionDidDieNotification object:outgoingConnection]; + [[NSNotificationCenter defaultCenter] addObserver:self + selector:@selector(connectionDidDie:) + name:NSPortTimeoutException + object:outgoingConnection]; NSMutableDictionary* anoperation=[NSMutableDictionary dictionaryWithCapacity:0]; { NSString* operation=[NSString stringWithString:@"CallBack"]; @@ -112,7 +156,10 @@ } else + { + std::cout << "Cound not connect to OsiriX!" << std::endl; return NO; + } return YES; @@ -121,11 +168,13 @@ - (void) connectionDidDie: (NSNotification *)notification { + //This will never be called if NSSocketPort is used to connect to server. if(remoteObjectProxy) { [remoteObjectProxy release]; remoteObjectProxy=nil; } + remoteConnection=nil; } #pragma mark- #pragma mark functions to interprete the operation request from OsiriX. @@ -138,9 +187,24 @@ { NSMutableDictionary* parameters=[request objectForKey:@"Parameters"]; NSString* registeredName=[parameters objectForKey:@"RegisteredName"]; - if(!remoteObjectProxy) - [self connectToRemoteObjectRegisteredAs:registeredName]; + NSNumber* supportSharedMem=[parameters objectForKey:@"SupportSharedMem"]; + ifSupportMemorySharing=[supportSharedMem boolValue]; + if(remoteObjectProxy) + { + [remoteObjectProxy release]; + remoteObjectProxy=nil; + } + outgoingConnectionRegisteredName=[registeredName copy]; +// if(!remoteObjectProxy) +// [self connectToRemoteObjectRegisteredAs:registeredName]; } + else if([operation isEqualToString:@"Breakup"]) + { + + [remoteConnection invalidate]; + outgoingConnectionRegisteredName=nil; + + } else if([operation isEqualToString:@"ParameterUpdate"]) { NSDictionary* parameters=[request objectForKey:@"Parameters"]; @@ -151,6 +215,7 @@ } - (NSDictionary*)getImage:(NSString*)description { + NSLog([NSString stringWithFormat:@"MeVisLab: OsiriX is asking for:%@", description] ); return [self prepareImageForUpperBridgeFromExporter:description]; } #pragma mark- @@ -161,54 +226,82 @@ { if(![self connectToRemoteObjectRegisteredAs:outgoingConnectionRegisteredName]) { - std::cout << "Cound not connect to OsiriX!" << std::endl; + //std::cout << "Cound not connect to OsiriX!" << std::endl; return nil; } } - + NSLog([NSString stringWithFormat:@"MeVisLab: MeVisLab is asking for:%@", description] ); NSDictionary* anImage=[remoteObjectProxy getImage:description]; if(anImage) - [imagesManager creatASharedImage:[anImage mutableCopy] ForDescription:description]; - + { + NSMutableDictionary*anNewImage=[anImage mutableCopy]; + [imagesManager creatASharedImage:anNewImage ForDescription:description SupportSharedMem:ifSupportMemorySharing]; + NSLog([NSString stringWithFormat:@"MeVisLab: %@ received", description] ); + [anNewImage release]; + + } return [imagesManager getImageForDescription: description]; } -(void)passingOnNotificationsToImporter:(NSDictionary*)parameters { + NSLog([NSString stringWithFormat:@"MeVisLab: OsiriX is notifying :%@", @"parameter changed"] ); importerML->updateParameters(parameters); } #pragma mark- #pragma mark functions when works as a bridge between Exporter and OsiriX -(NSDictionary*)prepareImageForUpperBridgeFromExporter:(NSString*)description { - NSMutableDictionary* tempImage=[NSMutableDictionary dictionaryWithCapacity:0]; + NSMutableDictionary* tempImage=[[NSMutableDictionary alloc] initWithCapacity:0]; [tempImage setObject:description forKey:@"Description"]; if([description isEqualToString:@"OutputImage0"]) { - exporterML->calcInputImageProps(tempImage, 0); - [tempImage setObject:[NSString stringWithString:@"float"] forKey:@"ImageType"]; - int dimension[4]={0,0,0,0}; - int i; - NSArray* dimensionarray=[tempImage objectForKey:@"Dimension"]; - for(i=0;i<4;i++) - dimension[i]=[[dimensionarray objectAtIndex:i] intValue]; - long size=dimension[0]*dimension[1]*dimension[2]*dimension[3]*sizeof(float); - [tempImage setObject:[NSNumber numberWithLong:size] forKey:@"MemSize"]; + if(exporterML->calcInputImageProps(tempImage, 0)) + { + [tempImage setObject:[NSString stringWithString:@"float"] forKey:@"ImageType"]; + int dimension[4]={0,0,0,0}; + int i; + NSArray* dimensionarray=[tempImage objectForKey:@"Dimension"]; + for(i=0;i<4;i++) + dimension[i]=[[dimensionarray objectAtIndex:i] intValue]; + long size=dimension[0]*dimension[1]*dimension[2]*dimension[3]*sizeof(float); + [tempImage setObject:[NSNumber numberWithLong:size] forKey:@"MemSize"]; + if(size<=0) + return nil; + } + else + return nil; } else if([description isEqualToString:@"OutputImage1"]) { - exporterML->calcInputImageProps(tempImage, 1); - [tempImage setObject:[NSString stringWithString:@"char"] forKey:@"ImageType"]; - int dimension[4]={0,0,0,0}; - int i; - NSArray* dimensionarray=[tempImage objectForKey:@"Dimension"]; - for(i=0;i<4;i++) - dimension[i]=[[dimensionarray objectAtIndex:i] intValue]; - long size=dimension[0]*dimension[1]*dimension[2]*dimension[3]*sizeof(char); - [tempImage setObject:[NSNumber numberWithLong:size] forKey:@"MemSize"]; + if(exporterML->calcInputImageProps(tempImage, 1)) + { + [tempImage setObject:[NSString stringWithString:@"char"] forKey:@"ImageType"]; + int dimension[4]={0,0,0,0}; + int i; + NSArray* dimensionarray=[tempImage objectForKey:@"Dimension"]; + for(i=0;i<4;i++) + dimension[i]=[[dimensionarray objectAtIndex:i] intValue]; + long size=dimension[0]*dimension[1]*dimension[2]*dimension[3]*sizeof(char); + [tempImage setObject:[NSNumber numberWithLong:size] forKey:@"MemSize"]; + if(size<=0) + return nil; + } + else + return nil; + } + else if([description isEqualToString:@"OutputImage2"]) + { +// if (exporterML->prepareCSOForOsiriX(tempImage)) +// { +// //savedImage ??????? +// } +// else + return nil; + } NSMutableDictionary* savedImage=[imagesManager getImageForDescription: description]; - if(savedImage&&[[savedImage objectForKey:@"MemSize"] longValue]==[[tempImage objectForKey:@"MemSize"] longValue]) + if((![description isEqualToString:@"OutputImage2"])&&savedImage&&[[savedImage objectForKey:@"MemSize"] longValue]==[[tempImage objectForKey:@"MemSize"] longValue]) { [savedImage setObject:[tempImage objectForKey:@"Dimension"] forKey:@"Dimension"]; [savedImage setObject:[tempImage objectForKey:@"Spacing"] forKey:@"Spacing"]; @@ -219,8 +312,9 @@ } else { - [imagesManager creatASharedImage:tempImage ForDescription:description]; + [imagesManager creatASharedImage:tempImage ForDescription:description SupportSharedMem:ifSupportMemorySharing]; } + [tempImage release]; NSMutableDictionary* resultImage=[imagesManager getImageForDescription: description]; if(resultImage) { @@ -233,12 +327,13 @@ exporterML->calcInSubImage(resultImage, 1); } - resultImage=[resultImage mutableCopy]; - [resultImage removeObjectForKey:@"Data"]; + resultImage=[[resultImage mutableCopy] autorelease]; + if(ifSupportMemorySharing) + [resultImage removeObjectForKey:@"Data"]; } - + NSLog([NSString stringWithFormat:@"MeVisLab: MeVisLab is sending:%@", description] ); return resultImage; } -(void)passingOnNotificationsToUpperBridge:(NSDictionary*)parameters @@ -247,7 +342,7 @@ { if(![self connectToRemoteObjectRegisteredAs:outgoingConnectionRegisteredName]) { - NSLog(@"Cound not connect to MeVisLab Exporter!"); + //NSLog(@"Cound not connect to MeVisLab Exporter!"); return; } } @@ -267,7 +362,7 @@ - (BOOL)initializeAnImageForSharing:(NSMutableDictionary*)anImage { - return [imagesManager creatASharedImage:anImage ForDescription:[anImage objectForKey:@"Description"]]; + return [imagesManager creatASharedImage:anImage ForDescription:[anImage objectForKey:@"Description"] SupportSharedMem:ifSupportMemorySharing]; } @end Modified: trunk/Community/General/Sources/ML/MLOsiriXImporter/MeVisLabHub/MeVisHubGUI.xib =================================================================== --- trunk/Community/General/Sources/ML/MLOsiriXImporter/MeVisLabHub/MeVisHubGUI.xib 2009-12-15 14:15:11 UTC (rev 222) +++ trunk/Community/General/Sources/ML/MLOsiriXImporter/MeVisLabHub/MeVisHubGUI.xib 2010-01-10 15:21:26 UTC (rev 223) @@ -47,7 +47,7 @@ <nil key="NSViewClass"/> <string key="NSWindowContentMaxSize">{3.40282e+38, 3.40282e+38}</string> <object class="NSView" key="NSWindowView" id="996985436"> - <reference key="NSNextResponder"/> + <nil key="NSNextResponder"/> <int key="NSvFlags">256</int> <object class="NSMutableArray" key="NSSubviews"> <bool key="EncodedWithXMLCoder">YES</bool> @@ -56,7 +56,6 @@ <int key="NSvFlags">297</int> <string key="NSFrame">{{669, 453}, {96, 32}}</string> <reference key="NSSuperview" ref="996985436"/> - <reference key="NSWindow"/> <bool key="NSEnabled">YES</bool> <object class="NSButtonCell" key="NSCell" id="868542321"> <int key="NSCellFlags">67239424</int> @@ -81,7 +80,6 @@ <int key="NSvFlags">297</int> <string key="NSFrame">{{669, 421}, {96, 32}}</string> <reference key="NSSuperview" ref="996985436"/> - <reference key="NSWindow"/> <bool key="NSEnabled">YES</bool> <object class="NSButtonCell" key="NSCell" id="841461954"> <int key="NSCellFlags">67239424</int> @@ -102,7 +100,6 @@ <int key="NSvFlags">297</int> <string key="NSFrame">{{669, 389}, {96, 32}}</string> <reference key="NSSuperview" ref="996985436"/> - <reference key="NSWindow"/> <bool key="NSEnabled">YES</bool> <object class="NSButtonCell" key="NSCell" id="543929613"> <int key="NSCellFlags">-2080244224</int> @@ -123,7 +120,6 @@ <int key="NSvFlags">303</int> <string key="NSFrame">{{18, 352}, {355, 17}}</string> <reference key="NSSuperview" ref="996985436"/> - <reference key="NSWindow"/> <bool key="NSEnabled">YES</bool> <object class="NSSliderCell" key="NSCell" id="471963150"> <int key="NSCellFlags">-2079981824</int> @@ -150,7 +146,6 @@ <int key="NSvFlags">303</int> <string key="NSFrame">{{68, 416}, {115, 17}}</string> <reference key="NSSuperview" ref="996985436"/> - <reference key="NSWindow"/> <bool key="NSEnabled">YES</bool> <object class="NSSliderCell" key="NSCell" id="77973335"> <int key="NSCellFlags">-2079981824</int> @@ -173,7 +168,6 @@ <int key="NSvFlags">303</int> <string key="NSFrame">{{404, 352}, {355, 17}}</string> <reference key="NSSuperview" ref="996985436"/> - <reference key="NSWindow"/> <bool key="NSEnabled">YES</bool> <object class="NSSliderCell" key="NSCell" id="524657236"> <int key="NSCellFlags">-2079981824</int> @@ -196,7 +190,6 @@ <int key="NSvFlags">303</int> <string key="NSFrame">{{15, 416}, {58, 17}}</string> <reference key="NSSuperview" ref="996985436"/> - <reference key="NSWindow"/> <bool key="NSEnabled">YES</bool> <object class="NSTextFieldCell" key="NSCell" id="580941129"> <int key="NSCellFlags">68288064</int> @@ -229,7 +222,6 @@ <int key="NSvFlags">303</int> <string key="NSFrame">{{15, 396}, {58, 17}}</string> <reference key="NSSuperview" ref="996985436"/> - <reference key="NSWindow"/> <bool key="NSEnabled">YES</bool> <object class="NSTextFieldCell" key="NSCell" id="263673420"> <int key="NSCellFlags">68288064</int> @@ -246,7 +238,6 @@ <int key="NSvFlags">303</int> <string key="NSFrame">{{244, 416}, {58, 17}}</string> <reference key="NSSuperview" ref="996985436"/> - <reference key="NSWindow"/> <bool key="NSEnabled">YES</bool> <object class="NSTextFieldCell" key="NSCell" id="154753079"> <int key="NSCellFlags">68288064</int> @@ -263,7 +254,6 @@ <int key="NSvFlags">303</int> <string key="NSFrame">{{244, 396}, {58, 17}}</string> <reference key="NSSuperview" ref="996985436"/> - <reference key="NSWindow"/> <bool key="NSEnabled">YES</bool> <object class="NSTextFieldCell" key="NSCell" id="122711045"> <int key="NSCellFlags">68288064</int> @@ -280,7 +270,6 @@ <int key="NSvFlags">303</int> <string key="NSFrame">{{458, 416}, {58, 17}}</string> <reference key="NSSuperview" ref="996985436"/> - <reference key="NSWindow"/> <bool key="NSEnabled">YES</bool> <object class="NSTextFieldCell" key="NSCell" id="445612229"> <int key="NSCellFlags">68288064</int> @@ -297,7 +286,6 @@ <int key="NSvFlags">303</int> <string key="NSFrame">{{458, 396}, {58, 17}}</string> <reference key="NSSuperview" ref="996985436"/> - <reference key="NSWindow"/> <bool key="NSEnabled">YES</bool> <object class="NSTextFieldCell" key="NSCell" id="213090265"> <int key="NSCellFlags">68288064</int> @@ -314,7 +302,6 @@ <int key="NSvFlags">315</int> <string key="NSFrame">{{404, 449}, {254, 46}}</string> <reference key="NSSuperview" ref="996985436"/> - <reference key="NSWindow"/> <bool key="NSEnabled">YES</bool> <object class="NSTextFieldCell" key="NSCell" id="217814428"> <int key="NSCellFlags">75628032</int> @@ -335,7 +322,6 @@ <int key="NSvFlags">303</int> <string key="NSFrame">{{191, 416}, {41, 22}}</string> <reference key="NSSuperview" ref="996985436"/> - <reference key="NSWindow"/> <bool key="NSEnabled">YES</bool> <object class="NSTextFieldCell" key="NSCell" id="523621866"> <int key="NSCellFlags">-1804468671</int> @@ -366,7 +352,6 @@ <int key="NSvFlags">303</int> <string key="NSFrame">{{68, 391}, {115, 17}}</string> <reference key="NSSuperview" ref="996985436"/> - <reference key="NSWindow"/> <int key="NSTag">3</int> <bool key="NSEnabled">YES</bool> <object class="NSSliderCell" key="NSCell" id="641199605"> @@ -390,7 +375,6 @@ <int key="NSvFlags">303</int> <string key="NSFrame">{{191, 391}, {41, 22}}</string> <reference key="NSSuperview" ref="996985436"/> - <reference key="NSWindow"/> <int key="NSTag">3</int> <bool key="NSEnabled">YES</bool> <object class="NSTextFieldCell" key="NSCell" id="257188581"> @@ -409,7 +393,6 @@ <int key="NSvFlags">303</int> <string key="NSFrame">{{289, 391}, {115, 17}}</string> <reference key="NSSuperview" ref="996985436"/> - <reference key="NSWindow"/> <int key="NSTag">4</int> <bool key="NSEnabled">YES</bool> <object class="NSSliderCell" key="NSCell" id="456784044"> @@ -433,7 +416,6 @@ <int key="NSvFlags">303</int> <string key="NSFrame">{{412, 391}, {41, 22}}</string> <reference key="NSSuperview" ref="996985436"/> - <reference key="NSWindow"/> <int key="NSTag">4</int> <bool key="NSEnabled">YES</bool> <object class="NSTextFieldCell" key="NSCell" id="494605495"> @@ -452,7 +434,6 @@ <int key="NSvFlags">303</int> <string key="NSFrame">{{499, 391}, {115, 17}}</string> <reference key="NSSuperview" ref="996985436"/> - <reference key="NSWindow"/> <int key="NSTag">5</int> <bool key="NSEnabled">YES</bool> <object class="NSSliderCell" key="NSCell" id="679370761"> @@ -476,7 +457,6 @@ <int key="NSvFlags">303</int> <string key="NSFrame">{{622, 391}, {41, 22}}</string> <reference key="NSSuperview" ref="996985436"/> - <reference key="NSWindow"/> <int key="NSTag">5</int> <bool key="NSEnabled">YES</bool> <object class="NSTextFieldCell" key="NSCell" id="661535805"> @@ -495,7 +475,6 @@ <int key="NSvFlags">319</int> <string key="NSFrame">{{18, 20}, {355, 324}}</string> <reference key="NSSuperview" ref="996985436"/> - <reference key="NSWindow"/> <string key="NSClassName">CMIVDCMView</string> </object> <object class="NSCustomView" id="604689374"> @@ -503,7 +482,6 @@ <int key="NSvFlags">319</int> <string key="NSFrame">{{404, 20}, {355, 324}}</string> <reference key="NSSuperview" ref="996985436"/> - <reference key="NSWindow"/> <string key="NSClassName">CMIVDCMView</string> </object> <object class="NSSlider" id="545665219"> @@ -511,7 +489,6 @@ <int key="NSvFlags">303</int> <string key="NSFrame">{{289, 416}, {115, 17}}</string> <reference key="NSSuperview" ref="996985436"/> - <reference key="NSWindow"/> <int key="NSTag">1</int> <bool key="NSEnabled">YES</bool> <object class="NSSliderCell" key="NSCell" id="774467762"> @@ -535,7 +512,6 @@ <int key="NSvFlags">303</int> <string key="NSFrame">{{412, 416}, {41, 22}}</string> <reference key="NSSuperview" ref="996985436"/> - <reference key="NSWindow"/> <int key="NSTag">1</int> <bool key="NSEnabled">YES</bool> <object class="NSTextFieldCell" key="NSCell" id="271908051"> @@ -554,7 +530,6 @@ <int key="NSvFlags">303</int> <string key="NSFrame">{{499, 416}, {115, 17}}</string> <reference key="NSSuperview" ref="996985436"/> - <reference key="NSWindow"/> <int key="NSTag">2</int> <bool key="NSEnabled">YES</bool> <object class="NSSliderCell" key="NSCell" id="838558130"> @@ -578,7 +553,6 @@ <int key="NSvFlags">303</int> <string key="NSFrame">{{622, 416}, {41, 22}}</string> <reference key="NSSuperview" ref="996985436"/> - <reference key="NSWindow"/> <int key="NSTag">2</int> <bool key="NSEnabled">YES</bool> <object class="NSTextFieldCell" key="NSCell" id="917073580"> @@ -597,7 +571,6 @@ <int key="NSvFlags">268</int> <string key="NSFrame">{{8, 449}, {286, 46}}</string> <reference key="NSSuperview" ref="996985436"/> - <reference key="NSWindow"/> <bool key="NSEnabled">YES</bool> <int key="NSNumRows">1</int> <int key="NSNumCols">5</int> @@ -753,8 +726,6 @@ </object> </object> <string key="NSFrameSize">{782, 501}</string> - <reference key="NSSuperview"/> - <reference key="NSWindow"/> </object> <string key="NSScreenRect">{{0, 0}, {1280, 1002}}</string> <string key="NSMaxSize">{3.40282e+38, 3.40282e+38}</string> @@ -769,7 +740,7 @@ <nil key="NSViewClass"/> <string key="NSWindowContentMaxSize">{3.40282e+38, 3.40282e+38}</string> <object class="NSView" key="NSWindowView" id="1027675405"> - <nil key="NSNextResponder"/> + <reference key="NSNextResponder"/> <int key="NSvFlags">256</int> <object class="NSMutableArray" key="NSSubviews"> <bool key="EncodedWithXMLCoder">YES</bool> @@ -788,6 +759,7 @@ <int key="NSvFlags">268</int> <string key="NSFrame">{{13, 494}, {104, 17}}</string> <reference key="NSSuperview" ref="982661092"/> + <reference key="NSWindow"/> <bool key="NSEnabled">YES</bool> <object class="NSTextFieldCell" key="NSCell" id="704936909"> <int key="NSCellFlags">67239424</int> @@ -804,6 +776,7 @@ <int key="NSvFlags">268</int> <string key="NSFrame">{{13, 465}, {104, 17}}</string> <reference key="NSSuperview" ref="982661092"/> + <reference key="NSWindow"/> <bool key="NSEnabled">YES</bool> <object class="NSTextFieldCell" key="NSCell" id="280972079"> <int key="NSCellFlags">67239424</int> @@ -820,6 +793,7 @@ <int key="NSvFlags">268</int> <string key="NSFrame">{{14, 399}, {98, 17}}</string> <reference key="NSSuperview" ref="982661092"/> + <reference key="NSWindow"/> <bool key="NSEnabled">YES</bool> <object class="NSTextFieldCell" key="NSCell" id="886043747"> <int key="NSCellFlags">67239424</int> @@ -836,6 +810,7 @@ <int key="NSvFlags">303</int> <string key="NSFrame">{{127, 488}, {419, 22}}</string> <reference key="NSSuperview" ref="982661092"/> + <reference key="NSWindow"/> <bool key="NSEnabled">YES</bool> <object class="NSTextFieldCell" key="NSCell" id="272168500"> <int key="NSCellFlags">343014976</int> @@ -853,6 +828,7 @@ <int key="NSvFlags">268</int> <string key="NSFrame">{{5, 519}, {112, 17}}</string> <reference key="NSSuperview" ref="982661092"/> + <reference key="NSWindow"/> <bool key="NSEnabled">YES</bool> <object class="NSTextFieldCell" key="NSCell" id="980269952"> <int key="NSCellFlags">67239424</int> @@ -869,6 +845,7 @@ <int key="NSvFlags">266</int> <string key="NSFrame">{{127, 517}, {187, 22}}</string> <reference key="NSSuperview" ref="982661092"/> + <reference key="NSWindow"/> <bool key="NSEnabled">YES</bool> <object class="NSTextFieldCell" key="NSCell" id="335863412"> <int key="NSCellFlags">343014976</int> @@ -886,6 +863,7 @@ <int key="NSvFlags">268</int> <string key="NSFrame">{{548, 482}, {83, 32}}</string> <reference key="NSSuperview" ref="982661092"/> + <reference key="NSWindow"/> <bool key="NSEnabled">YES</bool> <object class="NSButtonCell" key="NSCell" id="971874492"> <int key="NSCellFlags">67239424</int> @@ -904,8 +882,9 @@ <object class="NSMatrix" id="67108906"> <reference key="NSNextResponder" ref="982661092"/> <int key="NSvFlags">268</int> - <string key="NSFrame">{{127, 396}, {244, 18}}</string> + <string key="NSFrame">{{127, 396}, {138, 18}}</string> <reference key="NSSuperview" ref="982661092"/> + <reference key="NSWindow"/> <bool key="NSEnabled">YES</bool> <int key="NSNumRows">1</int> <int key="NSNumCols">2</int> @@ -1002,7 +981,7 @@ <int key="NSPeriodicInterval">75</int> </object> </object> - <string key="NSCellSize">{120, 18}</string> + <string key="NSCellSize">{67, 18}</string> <string key="NSIntercellSpacing">{4, 2}</string> <int key="NSMatrixFlags">1151868928</int> <string key="NSCellClass">NSActionCell</string> @@ -1088,6 +1067,7 @@ <int key="NSvFlags">257</int> <string key="NSFrame">{{398, -2}, {90, 32}}</string> <reference key="NSSuperview" ref="1020810615"/> + <reference key="NSWindow"/> <int key="NSTag">-1</int> <bool key="NSEnabled">YES</bool> <object class="NSButtonCell" key="NSCell" id="533058116"> @@ -1109,6 +1089,7 @@ <int key="NSvFlags">257</int> <string key="NSFrame">{{488, -2}, {90, 32}}</string> <reference key="NSSuperview" ref="1020810615"/> + <reference key="NSWindow"/> <int key="NSTag">-1</int> <bool key="NSEnabled">YES</bool> <object class="NSButtonCell" key="NSCell" id="872273893"> @@ -1140,12 +1121,14 @@ <int key="NSvFlags">256</int> <string key="NSFrameSize">{541, 100}</string> <reference key="NSSuperview" ref="248269985"/> + <reference key="NSWindow"/> <bool key="NSEnabled">YES</bool> <object class="NSTableHeaderView" key="NSHeaderView" id="269875735"> <reference key="NSNextResponder" ref="509461483"/> <int key="NSvFlags">256</int> <string key="NSFrameSize">{541, 17}</string> <reference key="NSSuperview" ref="509461483"/> + <reference key="NSWindow"/> <reference key="NSTableView" ref="154920836"/> </object> <object class="_NSCornerView" key="NSCornerView" id="524366895"> @@ -1153,6 +1136,7 @@ <int key="NSvFlags">256</int> <string key="NSFrame">{{542, 0}, {16, 17}}</string> <reference key="NSSuperview" ref="815595106"/> + <reference key="NSWindow"/> </object> <object class="NSMutableArray" key="NSTableColumns"> <bool key="EncodedWithXMLCoder">YES</bool> @@ -1610,6 +1594,7 @@ </object> <string key="NSFrame">{{1, 17}, {541, 100}}</string> <reference key="NSSuperview" ref="815595106"/> + <reference key="NSWindow"/> <reference key="NSNextKeyView" ref="154920836"/> <reference key="NSDocView" ref="154920836"/> <reference key="NSBGColor" ref="631745917"/> @@ -1620,6 +1605,7 @@ <int key="NSvFlags">256</int> <string key="NSFrame">{{542, 17}, {15, 100}}</string> <reference key="NSSuperview" ref="815595106"/> + <reference key="NSWindow"/> <reference key="NSTarget" ref="815595106"/> <string key="NSAction">_doScroller:</string> <double key="NSPercent">8.446602e-01</double> @@ -1629,6 +1615,7 @@ <int key="NSvFlags">256</int> <string key="NSFrame">{{1, 117}, {541, 15}}</string> <reference key="NSSuperview" ref="815595106"/> + <reference key="NSWindow"/> <int key="NSsFlags">1</int> <reference key="NSTarget" ref="815595106"/> <string key="NSAction">_doScroller:</string> @@ -1643,6 +1630,7 @@ </object> <string key="NSFrame">{{1, 0}, {541, 17}}</string> <reference key="NSSuperview" ref="815595106"/> + <reference key="NSWindow"/> <reference key="NSNextKeyView" ref="269875735"/> <reference key="NSDocView" ref="269875735"/> <reference key="NSBGColor" ref="631745917"/> @@ -1652,6 +1640,7 @@ </object> <string key="NSFrame">{{14, 30}, {558, 133}}</string> <reference key="NSSuperview" ref="1020810615"/> + <reference key="NSWindow"/> <reference key="NSNextKeyView" ref="248269985"/> <int key="NSsFlags">50</int> <reference key="NSVScroller" ref="264218514"/> @@ -1664,10 +1653,12 @@ </object> <string key="NSFrame">{{2, 2}, {586, 170}}</string> <reference key="NSSuperview" ref="709799150"/> + <reference key="NSWindow"/> </object> </object> <string key="NSFrame">{{10, 149}, {590, 187}}</string> <reference key="NSSuperview" ref="1070460728"/> + <reference key="NSWindow"/> <string key="NSOffsets">{0, 0}</string> <object class="NSTextFieldCell" key="NSTitleCell"> <int key="NSCellFlags">67239424</int> @@ -1705,6 +1696,7 @@ <int key="NSvFlags">257</int> <string key="NSFrame">{{401, -1}, {90, 32}}</string> <reference key="NSSuperview" ref="7298560"/> + <reference key="NSWindow"/> <int key="NSTag">-1</int> <bool key="NSEnabled">YES</bool> <object class="NSButtonCell" key="NSCell" id="50671173"> @@ -1726,6 +1718,7 @@ <int key="NSvFlags">257</int> <string key="NSFrame">{{491, -1}, {90, 32}}</string> <reference key="NSSuperview" ref="7298560"/> + <reference key="NSWindow"/> <int key="NSTag">-1</int> <bool key="NSEnabled">YES</bool> <object class="NSButtonCell" key="NSCell" id="643805265"> @@ -1757,12 +1750,14 @@ <int key="NSvFlags">256</int> <string key="NSFrameSize">{544, 65}</string> <reference key="NSSuperview" ref="997668256"/> + <reference key="NSWindow"/> <bool key="NSEnabled">YES</bool> <object class="NSTableHeaderView" key="NSHeaderView" id="602592387"> <reference key="NSNextResponder" ref="791469329"/> <int key="NSvFlags">256</int> <string key="NSFrameSize">{544, 17}</string> <reference key="NSSuperview" ref="791469329"/> + <reference key="NSWindow"/> <reference key="NSTableView" ref="87603344"/> </object> <object class="_NSCornerView" key="NSCornerView" id="297362808"> @@ -1770,6 +1765,7 @@ <int key="NSvFlags">256</int> <string key="NSFrame">{{545, 0}, {16, 17}}</string> <reference key="NSSuperview" ref="52013824"/> + <reference key="NSWindow"/> </object> <object class="NSMutableArray" key="NSTableColumns"> <bool key="EncodedWithXMLCoder">YES</bool> @@ -1986,7 +1982,7 @@ <reference key="NSTableView" ref="87603344"/> </object> <object class="NSTableColumn" id="36157426"> - <double key="NSWidth">9.300012e+01</double> + <double key="NSWidth">9.300015e+01</double> <double key="NSMinWidth">1.000000e+01</double> <double key="NSMaxWidth">3.402823e+38</double> <object class="NSTableHeaderCell" key="NSHeaderCell"> @@ -2032,6 +2028,7 @@ </object> <string key="NSFrame">{{1, 17}, {544, 65}}</string> <reference key="NSSuperview" ref="52013824"/> + <reference key="NSWindow"/> <reference key="NSNextKeyView" ref="87603344"/> <reference key="NSDocView" ref="87603344"/> <reference key="NSBGColor" ref="631745917"/> @@ -2042,6 +2039,7 @@ <int key="NSvFlags">256</int> <string key="NSFrame">{{545, 17}, {15, 65}}</string> <reference key="NSSuperview" ref="52013824"/> + <reference key="NSWindow"/> <reference key="NSTarget" ref="52013824"/> <string key="NSAction">_doScroller:</string> <double key="NSPercent">8.947368e-01</double> @@ -2051,6 +2049,7 @@ <int key="NSvFlags">256</int> <string key="NSFrame">{{1, 82}, {544, 15}}</string> <reference key="NSSuperview" ref="52013824"/> + <reference key="NSWindow"/> <int key="NSsFlags">1</int> <reference key="NSTarget" ref="52013824"/> <string key="NSAction">_doScroller:</string> @@ -2065,6 +2064,7 @@ </object> <string key="NSFrame">{{1, 0}, {544, 17}}</string> <reference key="NSSuperview" ref="52013824"/> + <reference key="NSWindow"/> <reference key="NSNextKeyView" ref="602592387"/> <reference key="NSDocView" ref="602592387"/> <reference key="NSBGColor" ref="631745917"/> @@ -2074,6 +2074,7 @@ </object> <string key="NSFrame">{{14, 27}, {561, 98}}</string> <reference key="NSSuperview" ref="7298560"/> + <reference key="NSWindow"/> <reference key="NSNextKeyView" ref="997668256"/> <int key="NSsFlags">50</int> <reference key="NSVScroller" ref="582323660"/> @@ -2086,10 +2087,12 @@ </object> <string key="NSFrame">{{2, 2}, {589, 121}}</string> <reference key="NSSuperview" ref="205537838"/> + <reference key="NSWindow"/> </object> </object> <string key="NSFrame">{{10, -1}, {593, 138}}</string> <reference key="NSSuperview" ref="1070460728"/> + <reference key="NSWindow"/> <string key="NSOffsets">{0, 0}</string> <object class="NSTextFieldCell" key="NSTitleCell"> <int key="NSCellFlags">67239424</int> @@ -2113,6 +2116,7 @@ <int key="NSvFlags">266</int> <string key="NSFrame">{{13, 342}, {411, 18}}</string> <reference key="NSSuperview" ref="1070460728"/> + <reference key="NSWindow"/> <int key="NSTag">-1</int> <bool key="NSEnabled">YES</bool> <object class="NSButtonCell" key="NSCell" id="183114318"> @@ -2135,6 +2139,7 @@ <int key="NSvFlags">266</int> <string key="NSFrame">{{13, 126}, {166, 18}}</string> <reference key="NSSuperview" ref="1070460728"/> + <reference key="NSWindow"/> <int key="NSTag">-1</int> <bool key="NSEnabled">YES</bool> <object class="NSButtonCell" key="NSCell" id="584388762"> @@ -2155,10 +2160,12 @@ </object> <string key="NSFrame">{{1, 1}, {610, 368}}</string> <reference key="NSSuperview" ref="968420748"/> + <reference key="NSWindow"/> </object> </object> <string key="NSFrame">{{4, 4}, {612, 384}}</string> <reference key="NSSuperview" ref="982661092"/> + <reference key="NSWindow"/> <string key="NSOffsets">{0, 0}</string> <object class="NSTextFieldCell" key="NSTitleCell"> <int key="NSCellFlags">67239424</int> @@ -2182,6 +2189,7 @@ <int key="NSvFlags">268</int> <string key="NSFrame">{{127, 432}, {419, 46}}</string> <reference key="NSSuperview" ref="982661092"/> + <reference key="NSWindow"/> <bool key="NSEnabled">YES</bool> <object class="NSTextFieldCell" key="NSCell" id="266811473"> <int key="NSCellFlags">-1805517311</int> @@ -2194,13 +2202,38 @@ <reference key="NSTextColor" ref="991998482"/> </object> </object> + <object class="NSButton" id="404710471"> + <reference key="NSNextResponder" ref="982661092"/> + <int key="NSvFlags">268</int> + <string key="NSFrame">{{381, 394}, {189, 18}}</string> + <reference key="NSSuperview" ref="982661092"/> + <reference key="NSWindow"/> + <bool key="NSEnabled">YES</bool> + <object class="NSButtonCell" key="NSCell" id="165892959"> + <int key="NSCellFlags">-2080244224</int> + <int key="NSCellFlags2">0</int> + <string key="NSContents">Support Shared Memory</string> + <reference key="NSSupport" ref="773563099"/> + <reference key="NSControlView" ref="404710471"/> + <int key="NSButtonFlags">1211912703</int> + <int key="NSButtonFlags2">130</int> + <reference key="NSNormalImage" ref="981498308"/> + <reference key="NSAlternateImage" ref="861216822"/> + <string key="NSAlternateContents"/> + <string key="NSKeyEquivalent"/> + <int key="NSPeriodicDelay">200</int> + <int key="NSPeriodicInterval">25</int> + </object> + </object> </object> <string key="NSFrame">{{2, 2}, {631, 545}}</string> <reference key="NSSuperview" ref="174241144"/> + <reference key="NSWindow"/> </object> </object> <string key="NSFrame">{{189, 48}, {635, 562}}</string> <reference key="NSSuperview" ref="1027675405"/> + <reference key="NSWindow"/> <string key="NSOffsets">{0, 0}</string> <object class="NSTextFieldCell" key="NSTitleCell"> <int key="NSCellFlags">67239424</int> @@ -2224,6 +2257,7 @@ <int key="NSvFlags">293</int> <string key="NSFrame">{{13, 45}, {90, 32}}</string> <reference key="NSSuperview" ref="1027675405"/> + <reference key="NSWindow"/> <int key="NSTag">-1</int> <bool key="NSEnabled">YES</bool> <object class="NSButtonCell" key="NSCell" id="363932874"> @@ -2245,6 +2279,7 @@ <int key="NSvFlags">293</int> <string key="NSFrame">{{98, 45}, {90, 32}}</string> <reference key="NSSuperview" ref="1027675405"/> + <reference key="NSWindow"/> <int key="NSTag">-1</int> <bool key="NSEnabled">YES</bool> <object class="NSButtonCell" key="NSCell" id="414102104"> @@ -2276,12 +2311,14 @@ <int key="NSvFlags">256</int> <string key="NSFrameSize">{199, 464}</string> <reference key="NSSuperview" ref="704670326"/> + <reference key="NSWindow"/> <bool key="NSEnabled">YES</bool> <object class="NSTableHeaderView" key="NSHeaderView" id="248526349"> <reference key="NSNextResponder" ref="984687643"/> <int key="NSvFlags">256</int> <string key="NSFrameSize">{199, 17}</string> <reference key="NSSuperview" ref="984687643"/> + <reference key="NSWindow"/> <reference key="NSTableView" ref="1065346365"/> </object> <object class="_NSCornerView" key="NSCornerView" id="180821553"> @@ -2289,6 +2326,7 @@ <int key="NSvFlags">256</int> <string key="NSFrame">{{152, 0}, {16, 17}}</string> <reference key="NSSuperview" ref="1011743800"/> + <reference key="NSWindow"/> </object> <object class="NSMutableArray" key="NSTableColumns"> <bool key="EncodedWithXMLCoder">YES</bool> @@ -2359,6 +2397,7 @@ </object> <string key="NSFrame">{{1, 17}, {151, 464}}</string> <reference key="NSSuperview" ref="1011743800"/> + <reference key="NSWindow"/> <reference key="NSNextKeyView" ref="1065346365"/> <reference key="NSDocView" ref="1065346365"/> <reference key="NSBGColor" ref="631745917"/> @@ -2369,6 +2408,7 @@ <int key="NSvFlags">256</int> <string key="NSFrame">{{152, 17}, {15, 464}}</string> <reference key="NSSuperview" ref="1011743800"/> + <reference key="NSWindow"/> <reference key="NSTarget" ref="1011743800"/> <string key="NSAction">_doScroller:</string> <double key="NSPercent">8.446602e-01</double> @@ -2378,6 +2418,7 @@ <int key="NSvFlags">256</int> <string key="NSFrame">{{1, 481}, {151, 15}}</string> <reference key="NSSuperview" ref="1011743800"/> + <reference key="NSWindow"/> <bool key="NSEnabled">YES</bool> <int key="NSsFlags">1</int> <reference key="NSTarget" ref="1011743800"/> @@ -2393,6 +2434,7 @@ </object> <string key="NSFrame">{{1, 0}, {151, 17}}</string> <reference key="NSSuperview" ref="1011743800"/> + <reference key="NSWindow"/> <reference key="NSNextKeyView" ref="248526349"/> <reference key="NSDocView" ref="248526349"/> <reference key="NSBGColor" ref="631745917"/> @@ -2402,6 +2444,7 @@ </object> <string key="NSFrame">{{20, 99}, {168, 497}}</string> <reference key="NSSuperview" ref="1027675405"/> + <reference key="NSWindow"/> <reference key="NSNextKeyView" ref="704670326"/> <int key="NSsFlags">178</int> <reference key="NSVScroller" ref="515971435"/> @@ -2416,6 +2459,7 @@ <int key="NSvFlags">293</int> <string key="NSFrame">{{726, 12}, {96, 32}}</string> <reference key="NSSuperview" ref="1027675405"/> + <reference key="NSWindow"/> <bool key="NSEnabled">YES</bool> <object class="NSButtonCell" key="NSCell" id="61866554"> <int key="NSCellFlags">67239424</int> @@ -2436,6 +2480,7 @@ <int key="NSvFlags">293</int> <string key="NSFrame">{{612, 12}, {96, 32}}</string> <reference key="NSSuperview" ref="1027675405"/> + <reference key="NSWindow"/> <int key="NSTag">1</int> <bool key="NSEnabled">YES</bool> <object class="NSButtonCell" key="NSCell" id="543427229"> @@ -2457,6 +2502,7 @@ <int key="NSvFlags">268</int> <string key="NSFrame">{{18, 604}, {74, 13}}</string> <reference key="NSSuperview" ref="1027675405"/> + <reference key="NSWindow"/> <bool key="NSEnabled">YES</bool> <object class="NSTextFieldCell" key="NSCell" id="13560843"> <int key="NSCellFlags">68288064</int> @@ -2474,6 +2520,8 @@ </object> </object> <string key="NSFrameSize">{842, 620}</string> + <reference key="NSSuperview"/> + <reference key="NSWindow"/> </object> <string key="NSScreenRect">{{0, 0}, {1280, 1002}}</string> <string key="NSMaxSize">{3.40282e+38, 3.40282e+38}</string> @@ -2491,6 +2539,7 @@ <string>IfShowMevisWindow</string> <string>IfSupportSeedsPlanting</string> <string>Instruction</string> + <string>IfSupportMemorySharing</string> </object> <bool key="NSEditable">YES</bool> <bool key="NSAutomaticallyPreparesContent">YES</bool> @@ -3686,6 +3735,22 @@ </object> <int key="connectionID">1540</int> </object> + <object class="IBConnectionRecord"> + <object class="IBBindingConnection" key="connection"> + <string key="label">value: selection.IfSupportMemorySharing</string> + <reference key="source" ref="404710471"/> + <reference key="destination" ref="328849661"/> + <object class="NSNibBindingConnector" key="connector"> + <reference key="NSSource" ref="404710471"/> + <reference key="NSDestination" ref="328849661"/> + <string key="NSLabel">value: selection.IfSupportMemorySharing</string> + <string key="NSBinding">value</string> + <string key="NSKeyPath">selection.IfSupportMemorySharing</string> + <int key="NSNibBindingConnectorVersion">2</int> + </object> + </object> + <int key="connectionID">1546</int> + </object> </object> <object class="IBMutableOrderedSet" key="objectRecords"> <object class="NSArray" key="orderedObjects"> @@ -4369,6 +4434,7 @@ <reference ref="162478303"/> <reference ref="558529068"/> <reference ref="423049781"/> + <reference ref="404710471"/> </object> <reference key="parent" ref="1027675405"/> </object> @@ -4919,6 +4985,20 @@ <reference key="object" ref="663364923"/> <reference key="parent" ref="36157426"/> </object> + <object class="IBObjectRecord"> + <int key="objectID">1541</int> + <reference key="object" ref="404710471"/> + <object class="NSMutableArray" key="children"> + <bool key="EncodedWithXMLCoder">YES</bool> + <reference ref="165892959"/> + </object> + <reference key="parent" ref="174241144"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">1542</int> + <reference key="object" ref="165892959"/> + <reference key="parent" ref="404710471"/> + </object> </object> </object> <object class="NSMutableDictionary" key="flattenedProperties"> @@ -5011,6 +5091,8 @@ <string>1518.IBPluginDependency</string> <string>1519.IBPluginDependency</string> <string>1528.IBPluginDependency</string> + <string>1541.IBPluginDependency</string> + <string>1542.IBPluginDependency</string> <string>819.IBPluginDependency</string> <string>918.IBEditorWindowLastContentRect</string> <string>918.IBWindowTemplateEditedContentRect</string> @@ -5111,13 +5193,15 @@ <string>com.apple.InterfaceBuilder.CocoaPlugin</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> + <string>com.apple.InterfaceBuilder.CocoaPlugin</string> + <string>com.apple.InterfaceBuilder.CocoaPlugin</string> <string>{{176, -90}, {782, 501}}</string> <string>{{176, -90}, {782, 501}}</string> <reference ref="6"/> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> - <string>{{118, 100}, {842, 620}}</string> + <string>{{91, 227}, {842, 620}}</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> - <string>{{118, 100}, {842, 620}}</string> + <string>{{91, 227}, {842, 620}}</string> <reference ref="6"/> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> </object> @@ -5142,7 +5226,7 @@ </object> </object> <nil key="sourceID"/> - <int key="maxID">1540</int> + <int key="maxID">1546</int> </object> <object class="IBClassDescriber" key="IBDocument.Classes"> <object class="NSMutableArray" key="referencedPartialClassDescriptions"> Modified: trunk/Community/General/Sources/ML/MLOsiriXImporter/MeVisLabHub/MeVisHubWindowController.h =================================================================== --- trunk/Community/General/Sources/ML/MLOsiriXImporter/MeVisLabHub/MeVisHubWindowController.h 2009-12-15 14:15:11 UTC (rev 222) +++ trunk/Community/General/Sources/ML/MLOsiriXImporter/MeVisLabHub/MeVisHubWindowController.h 2010-01-10 15:21:26 UTC (rev 223) @@ -53,6 +53,13 @@ NSManagedObject* currentSeedingTool; NSDictionary* outputMaskResult; int currentSychronizeMode; + float transformmatrix[16]; + float outputTransformmatrix[16]; + BOOL updatingROI; + BOOL changingParameters; + BOOL ifOutputMask1Available; + BOOL ifSupportMemorySharing; + } -(id)initFromNIB; -(void)setWindowController:(ViewerController*)viewer; @@ -75,8 +82,15 @@ - (void)initializeToolsBar:(NSManagedObject*)configDict; - (IBAction)updateOutputImage:(id)sender; - (void)notifyMeVisLabSeedsChanged; +- (void)notifyMeVisLabCSOChanged; - (IBAction)closeCurrentWindow:(id)sender; -(int)checkSynchronizeMode; -(void)updateMasksForOutputView:(int)index; -- (void)initializeOutputViewROI; +- (void)initializeOutputViewBrushROI; +- (void)updateOutputViewCSOROI:(NSDictionary*)overlayObjects; +- (void)handleMeVisLabNotification:(NSDictionary*) parameters; +-(void)invert4X4Matrix:(float*)inElements: (float*) outElements; +-(double) matrixDeterminant:(float*) elem; +-(void) matrixAdjoint: (float*) inElem: (float*) outElem; +-(float) matrixDeterminant3x3:(float)c10:(float)c11:(float)c12:(float)c20:(float)c21:(float)c22:(float)c30:(float)c31:(float)c32; @end Modified: trunk/Community/General/Sources/ML/MLOsiriXImporter/MeVisLabHub/MeVisHubWindowController.m =================================================================== --- trunk/Community/General/Sources/ML/MLOsiriXImporter/MeVisLabHub/MeVisHubWindowController.m 2009-12-15 14:15:11 UTC (rev 222) +++ trunk/Community/General/Sources/ML/MLOsiriXImporter/MeVisLabHub/MeVisHubWindowController.m 2010-01-10 15:21:26 UTC (rev 223) @@ -43,26 +43,39 @@ [operationController setSelectedObjects:[NSArray arrayWithObject:operationConfigDict]]; NSString* operationName=[operationConfigDict valueForKey:@"OperationName"]; + ifSupportMemorySharing=[[operationConfigDict valueForKey:@"IfSupportMemorySharing"] boolValue]; + NSString* osiriXImporterName=[[NSString stringWithString:@"OsiriXImporter:"] stringByAppendingString:operationName]; + bridgeExportToMeVisLab=[[OsiriX2MeVisLabTBridge alloc] initWithIncommingConnectionName:@"MeVisHub:Exporter" SupportSharedMem:ifSupportMemorySharing]; + [bridgeExportToMeVisLab setWindowController:self]; - bridgeExportToMeVisLab=[[OsiriX2MeVisLabTBridge alloc] initWithIncommingConnectionName:@"MeVisHub:Exporter" OutgoingConnection:[[NSString stringWithString:@"OsiriXImporter:"] stringByAppendingString:operationName]]; - bridgeImportFromMeVisLab=[[OsiriX2MeVisLabTBridge alloc] initWithIncommingConnectionName:@"MeVisHub:Importer" OutgoingConnection:[[NSString stringWithString:@"OsiriXExporter:"] stringByAppendingString:operationName]]; + NSString* osiriXExporterName=[[NSString stringWithString:@"OsiriXExporter:"] stringByAppendingString:operationName]; + bridgeImportFromMeVisLab=[[OsiriX2MeVisLabTBridge alloc] initWithIncommingConnectionName:@"MeVisHub:Importer" SupportSharedMem:ifSupportMemorySharing]; + [bridgeImportFromMeVisLab setWindowController:self]; + BOOL isRemoteOperation=NO; if([self prepareInputImages]) { //try to connect to MeVisLab - NSString* operationName=[NSString stringWithString:@"OsiriXImporter:"]; - operationName=[operationName stringByAppendingString:[operationConfigDict valueForKey:@"OperationName"]]; - if(![bridgeExportToMeVisLab connectToRemoteObjectRegisteredAs:operationName]) + NSString* commandLineString = [operationConfigDict valueForKey:@"CommandLineStr"]; + if([commandLineString hasPrefix:@"Remote"]) { - NSString* commandLineString = [operationConfigDict valueForKey:@"CommandLineStr"]; + isRemoteOperation=YES; + if([bridgeExportToMeVisLab connectToRemoteObjectRegisteredAs:osiriXImporterName]==NO) + NSRunAlertPanel(@"Failed", @"Failed to run this function, Please make sure the server is running." ,nil, nil, nil); + + } + else if(![bridgeExportToMeVisLab connectToRemoteObjectRegisteredAs:osiriXImporterName]) + { + + [self runCommandLineForOperation:commandLineString]; int sleepTime=0; do{ sleep(3); sleepTime+=3; - }while(sleepTime<=30 && ([bridgeExportToMeVisLab connectToRemoteObjectRegisteredAs:operationName] == NO)); + }while(sleepTime<=30 && ([bridgeExportToMeVisLab connectToRemoteObjectRegisteredAs:osiriXImporterName] == NO)); if( sleepTime>30 ) { NSRunAlertPanel(@"Failed", @"Failed to run this function, the link to this function is broken." ,nil, nil, nil); @@ -76,10 +89,12 @@ NSNumber* needshowMeVisLabGUI = [operationConfigDict valueForKey:@"IfShowMevisWindow"]; if(![needshowMeVisLabGUI boolValue]) { + [bridgeImportFromMeVisLab connectToRemote... [truncated message content] |
From: <of...@us...> - 2009-12-15 14:15:19
|
Revision: 222 http://mevislabmodules.svn.sourceforge.net/mevislabmodules/?rev=222&view=rev Author: ofriman Date: 2009-12-15 14:15:11 +0000 (Tue, 15 Dec 2009) Log Message: ----------- Reverted temporarily from ML 2.1 to ML 2.0 library. Modified Paths: -------------- trunk/Community/General/Sources/ML/MLFuzzyConnectedness/mlFuzzyConnectedness.cpp Modified: trunk/Community/General/Sources/ML/MLFuzzyConnectedness/mlFuzzyConnectedness.cpp =================================================================== --- trunk/Community/General/Sources/ML/MLFuzzyConnectedness/mlFuzzyConnectedness.cpp 2009-12-14 13:55:27 UTC (rev 221) +++ trunk/Community/General/Sources/ML/MLFuzzyConnectedness/mlFuzzyConnectedness.cpp 2009-12-15 14:15:11 UTC (rev 222) @@ -48,7 +48,7 @@ // avoid side effects during initialization phase. handleNotificationOff(); - // Initialise fields + //Initialise fields _startButtonFld = getFieldContainer()->addNotify("startButton"); _autoUpdateFld = getFieldContainer()->addBool("autoUpdate"); @@ -56,7 +56,7 @@ handleNotificationOn(); // Activate parallel execution of calcOutSubImage. - setThreadSupport(NO_THREAD_SUPPORT); + setThreadSupport(NO_THREAD_SUPPORT ); // Specify whether the module can only process standard scalar voxel types or // also registered voxel types (vec2, mat2, complexf, Vector, etc.) @@ -75,12 +75,12 @@ void FuzzyConnectedness::handleNotification (Field *field) { ML_TRACE_IN("FuzzyConnectedness::handleNotification ()"); - // Calculation will only be performed if either the start - // button is pressed or the auto update mechanism is used. + // button is pressed or the auto update mechanism is used. if ((field ==_startButtonFld) || ((field != _startButtonFld) && _autoUpdateFld->isOn())) { - //\xB4If either input image is open the calculation will be cancelled. + _state = ML_RESULT_OK; + //If either input image is open the calculation will be cancelled. if(!getUpdatedInImg(0) || !getUpdatedInImg(1)) { _state = ML_DISCONNECTED_GRAPH; @@ -93,16 +93,16 @@ else { // Same extent of image data and seed point image are required - if ( getUpdatedInImg(0)->getImgExt() != getUpdatedInImg(1)->getImgExt() ){ - _state = ML_BAD_DIMENSION; + if ( getUpdatedInImg(0)->getImgExt() != getUpdatedInImg(1)->getImgExt() ) + { + _state=ML_BAD_DIMENSION; } // Calculation will be started here else{ _state = calculate(getUpdatedInImg(0),getUpdatedInImg(1)); } } - - // Let connected modules know that the output has changed. + // Let the connected modules know that the output has changed. getOutField(0)->notifyAttachments(); getOutField(1)->notifyAttachments(); } @@ -123,19 +123,21 @@ _inputTmpImg.setBox(box); _pointerTmpImg.setBox(box); // Copy input image - MLErrorCode status = getTile(inputData, _inputTmpImg); + + MLErrorCode status =getTile(inputData->getBaseOp(),inputData->getOutIndex(),_inputTmpImg); if(status==ML_RESULT_OK) - { + { // Copy seed points - status = getTile(inputMarker,_labelMapOutImg); + status = getTile(inputMarker->getBaseOp(),inputMarker->getOutIndex(),_labelMapOutImg); if(status==ML_RESULT_OK) - { + { // Allocate memory for the connectivity map. - _connectivityMapOutImg.allocateAsMemoryBlockHandle(); + _connectivityMapOutImg.allocate(ML_RETURN_NULL); + if(_connectivityMapOutImg.getData()!=NULL) { // Allocate memory for the temporary image used internally. - _pointerTmpImg.allocateAsMemoryBlockHandle(); + _pointerTmpImg.allocate(ML_RETURN_NULL); if( _pointerTmpImg.getData() != NULL ) { // Calculate the minimum and maximum intensity values in the image. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <of...@us...> - 2009-12-14 13:55:40
|
Revision: 221 http://mevislabmodules.svn.sourceforge.net/mevislabmodules/?rev=221&view=rev Author: ofriman Date: 2009-12-14 13:55:27 +0000 (Mon, 14 Dec 2009) Log Message: ----------- New module FuzzyConnectedness. Added Paths: ----------- trunk/Community/General/Modules/ML/MLFuzzyConnectedness/ trunk/Community/General/Modules/ML/MLFuzzyConnectedness/MLFuzzyConnectedness.def trunk/Community/General/Modules/ML/MLFuzzyConnectedness/html/ trunk/Community/General/Modules/ML/MLFuzzyConnectedness/html/MLFuzzyConnectedness.html trunk/Community/General/Modules/ML/MLFuzzyConnectedness/html/images/ trunk/Community/General/Modules/ML/MLFuzzyConnectedness/html/images/FuzzyConnectednessSeeds.png trunk/Community/General/Modules/ML/MLFuzzyConnectedness/html/images/FuzzyConnectednessVoxel.png trunk/Community/General/Modules/ML/MLFuzzyConnectedness/html/images/Neighbor.png trunk/Community/General/Modules/ML/MLFuzzyConnectedness/html/images/Nodes.png trunk/Community/General/Modules/ML/MLFuzzyConnectedness/html/images/Path.png trunk/Community/General/Modules/ML/MLFuzzyConnectedness/html/images/PathStrength.png trunk/Community/General/Modules/ML/MLFuzzyConnectedness/html/images/Rho.png trunk/Community/General/Modules/ML/MLFuzzyConnectedness/networks/ trunk/Community/General/Modules/ML/MLFuzzyConnectedness/networks/MLFuzzyConnectednessExample.mlab trunk/Community/General/Sources/ML/MLFuzzyConnectedness/ trunk/Community/General/Sources/ML/MLFuzzyConnectedness/CMIVFuzzyConnectedness.cpp trunk/Community/General/Sources/ML/MLFuzzyConnectedness/CMIVFuzzyConnectedness.h trunk/Community/General/Sources/ML/MLFuzzyConnectedness/MLFuzzyConnectedness.bat trunk/Community/General/Sources/ML/MLFuzzyConnectedness/MLFuzzyConnectedness.pro trunk/Community/General/Sources/ML/MLFuzzyConnectedness/MLFuzzyConnectedness.sh trunk/Community/General/Sources/ML/MLFuzzyConnectedness/MLFuzzyConnectednessInit.cpp trunk/Community/General/Sources/ML/MLFuzzyConnectedness/MLFuzzyConnectednessSystem.h trunk/Community/General/Sources/ML/MLFuzzyConnectedness/gpl.txt trunk/Community/General/Sources/ML/MLFuzzyConnectedness/lgpl.txt trunk/Community/General/Sources/ML/MLFuzzyConnectedness/mlFuzzyConnectedness.cpp trunk/Community/General/Sources/ML/MLFuzzyConnectedness/mlFuzzyConnectedness.h Added: trunk/Community/General/Modules/ML/MLFuzzyConnectedness/MLFuzzyConnectedness.def =================================================================== --- trunk/Community/General/Modules/ML/MLFuzzyConnectedness/MLFuzzyConnectedness.def (rev 0) +++ trunk/Community/General/Modules/ML/MLFuzzyConnectedness/MLFuzzyConnectedness.def 2009-12-14 13:55:27 UTC (rev 221) @@ -0,0 +1,39 @@ +// **InsertLicense** code +//---------------------------------------------------------------------------------- +//! MLFuzzyConnectedness module definitions. +/*! +// \file MLFuzzyConnectedness.def +// \author Markus H\xFCllebrand +// \date 2009-06-12 +*/ +//---------------------------------------------------------------------------------- + + +//---------------------------------------------------------------------------------- +// MLModule MLFuzzyConnectedness +//---------------------------------------------------------------------------------- +MLModule FuzzyConnectedness { + DLL = "MLFuzzyConnectedness" + + genre = "Fuzzy" + author = "Markus H\xFCllebrand, Chunliang Wang, Ola Friman" + status = "stable" + comment = "Calculates a fuzzy connectedness classification" + keywords = "fuzzy connectedness classification segmentation" + seeAlso = "MarkerToMask" + documentation = "$(LOCAL)/html/MLFuzzyConnectedness.html" + exampleNetwork = "$(LOCAL)/networks/MLFuzzyConnectednessExample.mlab" + + Window { + Vertical { + margin = 5 + Horizontal { + Button startButton { + title = "Start" + } + Field autoUpdate {} + } + } + } +} // MLModule MLFuzzyConnectedness + Property changes on: trunk/Community/General/Modules/ML/MLFuzzyConnectedness/MLFuzzyConnectedness.def ___________________________________________________________________ Added: svn:eol-style + native Added: trunk/Community/General/Modules/ML/MLFuzzyConnectedness/html/MLFuzzyConnectedness.html =================================================================== --- trunk/Community/General/Modules/ML/MLFuzzyConnectedness/html/MLFuzzyConnectedness.html (rev 0) +++ trunk/Community/General/Modules/ML/MLFuzzyConnectedness/html/MLFuzzyConnectedness.html 2009-12-14 13:55:27 UTC (rev 221) @@ -0,0 +1,380 @@ +<!DOCTYPE html PUBLIC "-//w3c//dtd html 4.0 transitional//en"> +<html> +<head> + + + + + + + + + + + + <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> + + + + + + + + + + + + <meta name="GENERATOR" content="Mozilla/4.78 [en] (Windows NT 5.0; U) [Netscape]"> + + + + + + + + + + + + <meta name="Description" content="MeVisLab module help page template"> + + + + + + + + + + + <title>Module Help Page</title> +</head> + + +<body> + + + + + + +<center><a href="#Purpose">Purpose</a> +<a href="#Usage">Usage</a> +<a href="#Details">Details</a> +<a href="#Inputs">Inputs</a> +<a href="#Outputs">Outputs</a> +<a href="#Parameters">Parameters</a> +<a href="#EventInteract">Events&Interaction</a> +<a href="#Example">Example</a> +<a href="#Tips&Tricks">Tips&Tricks</a> +<a href="#KnownBugs">Known +Bugs</a> +<hr width="100%"></center> + + + + + + +<h2>FuzzyConnectedness</h2> + + + + + + +<h3> +<a name="Purpose"></a>Purpose</h3> + + + + + + +<blockquote>Given an input image and an image with seed points, the <span style="font-weight: bold;">FuzzyConnectedness</span> module +calculates a map of connectivities from each voxel to the seed points, +as well as a label image in which each voxel is labeled according to +which seed point it is closest to in the fuzzy connectivity sense. Due +to the definition of fuzzy connectedness (see below), the implemented +algorithm is suited for segmenting or separating bright objects on a +dark background.</blockquote> + + + + + + +<h3> +<a name="Usage"></a>Usage</h3> + + + + + + +<blockquote>A 2D or 3D scalar gray-value image is attached to <span style="font-weight: bold;">input0</span>. +An image of the same size containing different seed regions, +labeled with integer number from 1 to 64, is attached to <span style="font-weight: bold;">input1</span>.<br> + + +As shown in the example network, the <span style="font-weight: bold;">SoView2DMarkerEditor</span> can be used together with the <span style="font-weight: bold;">MarkerToMask</span> module to produce the seed region image. Set the <span style="font-style: italic;">Current Type</span> value in <span style="font-weight: bold;">SoView2DMarkerEditor</span> to values between 1 and 63 to define different seed regions, and use the <span style="font-style: italic;">Marker Type</span> option in the <span style="font-weight: bold;">MarkerToMask</span> module. + + + +</blockquote> + + + + + + +<h3> +<a name="Details"></a>Details</h3> + + + + + + +<blockquote>This module implements the fuzzy connectedness algorithm published in:<br> + + + <br> + + +Xavier Tizon and Örjan Smedby<br> + + + <span style="font-style: italic;">Segmentation with gray-scale connectedness can separate arteries and veins in MRA </span><br> + + +J. Magn. Reson. Imaging 2002; 15:438-445<br> + + + <br> + + + + + +As described in this paper the fuzzy connectedness to given seed regions are calculated. <br> + + + + +A path <img style="width: 19px; height: 19px;" alt="rho" src="images/Rho.png"> between between two voxels u,v is defined as a sequence of distinct voxels,<br> + + + + + <img style="width: 149px; height: 16px;" alt="u=w_0, ... , w_n=v" src="images/Path.png"><br> + +where each voxel in the path is a neighbor to the previous voxel in a +8-neighborhood or 26-neighborhood in 2D and 3D respectively:<br> + + + + + <img style="width: 214px; height: 21px;" alt="w_(n+1) in N(w_i) for 0<= i < n" src="images/Nodes.png">.<br> + + + <br> + + + + +The strength of path <img style="width: 17px; height: 17px;" alt="rho" src="images/Rho.png">is the minimum of the intensity value of the traversed voxels:<br> + + + + + <img style="width: 199px; height: 48px;" alt="S(rho)=min_(w in rho) (g(w))" src="images/PathStrength.png"><br> + + + + + where <span style="font-style: italic;">g</span>(..) represent the voxel intensity. The fuzzy connectedness between a seed region and a +voxel is the maximum strength among all paths to from the region to the voxel:<br> + + + + + <img style="width: 241px; height: 58px;" alt="" src="images/FuzzyConnectednessSeeds.png">.<br> +A connectivity map is calculated for each seed region, and the output +connectivity map is the maximum connectivity over all seed regions. The +label map +indicates to which seed region each voxel belongs.<br> + + + + + +Due to the definition of the connectedness and due to the concurrent +approach, seed points with higher intensity will overweight those +with lower intensities.<br> + + + + + + <br> + + + + + +</blockquote> + + + + + + +<h3> +<a name="Inputs"></a>Inputs</h3> + + + + + + +<blockquote> + <span style="font-weight: bold;">Input0 + </span><span style="font-size: 12pt; font-weight: normal;" lang="EN-US">must +be a scalar volume.<span style="font-weight: bold;"><br> + + +Input1</span> +is a mask of the different seed regions. The seed regions can be +represented by integer values from 1 to 63. Values > 63 in the +mask will be treated as barriers and the propagation will stop from +each side.</span> +</blockquote> + + + + + + +<h3> +<a name="Outputs"></a>Outputs</h3> + + + + + + +<blockquote><span style="font-weight: bold;">Output0</span> +is the concurrent connectivity map. <span style="font-weight: bold;">Output1</span> +is the label map.</blockquote> + + + + + + +<h3> +<a name="Parameters"></a>Parameters</h3> + + + + + + +<blockquote>None<br> + + + + + + +</blockquote> + + + + + + +<h3> +<a name="EventInteract"></a>Events & +Interaction</h3> + + + + + + None + +<h3> +<a name="Example"></a>Example</h3> + + + + + + +<blockquote> + + + + + + <h3><span style="font-size: 12pt; font-weight: normal;" lang="EN-US">See example network.</span></h3> + + + + + + +</blockquote> + + + + + + +<h3> +<a name="Tips&Tricks"></a>Tips & Tricks</h3> + + + + + + +<blockquote>- This module does not support paging. Therefore the complete image has to be stored.<br> + + + + + +- Seed voxels with high intensities will outweight seed voxels with low intensities.</blockquote> + + + + + + +<h3> +<a name="KnownBugs"></a>Known Bugs</h3> + + + + + + +<blockquote>None<br> + + + + + + +</blockquote> + + + + + + +</body> +</html> Property changes on: trunk/Community/General/Modules/ML/MLFuzzyConnectedness/html/MLFuzzyConnectedness.html ___________________________________________________________________ Added: svn:eol-style + native Added: trunk/Community/General/Modules/ML/MLFuzzyConnectedness/html/images/FuzzyConnectednessSeeds.png =================================================================== (Binary files differ) Property changes on: trunk/Community/General/Modules/ML/MLFuzzyConnectedness/html/images/FuzzyConnectednessSeeds.png ___________________________________________________________________ Added: svn:mime-type + image/png Added: trunk/Community/General/Modules/ML/MLFuzzyConnectedness/html/images/FuzzyConnectednessVoxel.png =================================================================== (Binary files differ) Property changes on: trunk/Community/General/Modules/ML/MLFuzzyConnectedness/html/images/FuzzyConnectednessVoxel.png ___________________________________________________________________ Added: svn:mime-type + image/png Added: trunk/Community/General/Modules/ML/MLFuzzyConnectedness/html/images/Neighbor.png =================================================================== (Binary files differ) Property changes on: trunk/Community/General/Modules/ML/MLFuzzyConnectedness/html/images/Neighbor.png ___________________________________________________________________ Added: svn:mime-type + image/png Added: trunk/Community/General/Modules/ML/MLFuzzyConnectedness/html/images/Nodes.png =================================================================== (Binary files differ) Property changes on: trunk/Community/General/Modules/ML/MLFuzzyConnectedness/html/images/Nodes.png ___________________________________________________________________ Added: svn:mime-type + image/png Added: trunk/Community/General/Modules/ML/MLFuzzyConnectedness/html/images/Path.png =================================================================== (Binary files differ) Property changes on: trunk/Community/General/Modules/ML/MLFuzzyConnectedness/html/images/Path.png ___________________________________________________________________ Added: svn:mime-type + image/png Added: trunk/Community/General/Modules/ML/MLFuzzyConnectedness/html/images/PathStrength.png =================================================================== (Binary files differ) Property changes on: trunk/Community/General/Modules/ML/MLFuzzyConnectedness/html/images/PathStrength.png ___________________________________________________________________ Added: svn:mime-type + image/png Added: trunk/Community/General/Modules/ML/MLFuzzyConnectedness/html/images/Rho.png =================================================================== (Binary files differ) Property changes on: trunk/Community/General/Modules/ML/MLFuzzyConnectedness/html/images/Rho.png ___________________________________________________________________ Added: svn:mime-type + image/png Added: trunk/Community/General/Modules/ML/MLFuzzyConnectedness/networks/MLFuzzyConnectednessExample.mlab =================================================================== --- trunk/Community/General/Modules/ML/MLFuzzyConnectedness/networks/MLFuzzyConnectednessExample.mlab (rev 0) +++ trunk/Community/General/Modules/ML/MLFuzzyConnectedness/networks/MLFuzzyConnectednessExample.mlab 2009-12-14 13:55:27 UTC (rev 221) @@ -0,0 +1,487 @@ +// MDL v1 utf8 +network { + watchlist = "" +} +module StylePalette { + internal { + frame = "105 425 96 56" + moduleGroupName = "Seed selection" + } + fields { + instanceName = StylePalette + color1 = "1 1 0" + color2 = "1 0 0" + color3 = "0 0 1" + color4 = "0 1 0" + color5 = "1 0.5 0" + color6 = "1 0 1" + color7 = "0 1 1" + color8 = "0.5 1 0.5" + color9 = "1 0 0.5" + color10 = "0.5 1 0" + color11 = "0.5 0 1" + color12 = "0 1 0.5" + lineStyle1 = Solid + lineStyle2 = Solid + lineStyle3 = Solid + lineStyle4 = Solid + lineStyle5 = Solid + lineStyle6 = Solid + lineStyle7 = Solid + lineStyle8 = Solid + lineStyle9 = Solid + lineStyle10 = Solid + lineStyle11 = Solid + lineStyle12 = Solid + lineWidth1 = 1 + lineWidth2 = 1 + lineWidth3 = 1 + lineWidth4 = 1 + lineWidth5 = 1 + lineWidth6 = 1 + lineWidth7 = 1 + lineWidth8 = 1 + lineWidth9 = 1 + lineWidth10 = 1 + lineWidth11 = 1 + lineWidth12 = 1 + markerType1 = None + markerType2 = None + markerType3 = None + markerType4 = None + markerType5 = None + markerType6 = None + markerType7 = None + markerType8 = None + markerType9 = None + markerType10 = None + markerType11 = None + markerType12 = None + markerSize1 = 4 + markerSize2 = 4 + markerSize3 = 4 + markerSize4 = 4 + markerSize5 = 4 + markerSize6 = 4 + markerSize7 = 4 + markerSize8 = 4 + markerSize9 = 4 + markerSize10 = 4 + markerSize11 = 4 + markerSize12 = 4 + antiAlias1 = FALSE + antiAlias2 = FALSE + antiAlias3 = FALSE + antiAlias4 = FALSE + antiAlias5 = FALSE + antiAlias6 = FALSE + antiAlias7 = FALSE + antiAlias8 = FALSE + antiAlias9 = FALSE + antiAlias10 = FALSE + antiAlias11 = FALSE + antiAlias12 = FALSE + name1 = "" + name2 = "" + name3 = "" + name4 = "" + name5 = "" + name6 = "" + name7 = "" + name8 = "" + name9 = "" + name10 = "" + name11 = "" + name12 = "" + currentStyle = 0 + currentColor = "1 1 1" + currentLineStyle = None + currentLineWidth = 1 + currentMarkerType = None + currentMarkerSize = 4 + currentAntiAlias = FALSE + currentName = "" + reservedEntries = 0 + } +} +module MarkerToMask { + internal { + frame = "113 205 112 56" + moduleGroupName = "Seed selection" + windows { + window _default { + geometry = "542 464 235 141" + sizeHint = "235 141" + wasOpen = no + wasActive = no + } + } + } + fields { + instanceName = MarkerToMask + maskValue = 1 + backgroundValue = 0 + autoUpdate = TRUE + writeMode = MarkerType + outputType = int16 + } +} +module SoView2DMarkerEditor { + internal { + frame = "81 353 160 56" + moduleGroupName = "Seed selection" + windows { + window _default { + geometry = "847 145 435 831" + sizeHint = "435 831" + wasOpen = yes + wasActive = no + } + } + } + fields { + drawingOn = TRUE + editingOn = TRUE + maskValid = FALSE + fixZOn = TRUE + color = "1 0 0" + selectionTolerance = 4 + needsValidVoxel = TRUE + button1 = PRESSED + button2 = IGNORED + button3 = IGNORED + shift = IGNORED + control = IGNORED + alt = IGNORED + wantsAllEvents = FALSE + wantsKeyEvents = TRUE + wantsMouseWheelEvents = FALSE + setEventHandled = FALSE + ignoreHandledEvents = FALSE + createNewMode = FALSE + renderOnSlab = FALSE + clipToSlice = FALSE + cursorShape = UNDEFINED_CURSOR + depthVisibility = 1 + snapToVoxel = TRUE + snapToSlice = TRUE + currentType = 3 + deleteOnClick = TRUE + addOnClick = TRUE + alphaFactor = 1 + iconFile = $(MLAB_MeVisLab_Standard)/Modules/Resources/Images/markerIcons.tif + internalIconFile = "C:/Program Files (x86)/MeVisLab2.1aVC9-64/Packages/MeVisLab/Standard/Modules/Resources/Images/markerIcons.tif" + useIconFile = FALSE + iconIdx = 0 + selectingOn = TRUE + actOnReleaseOnly = FALSE + editorMode = EDIT_MARKER + colorMode = COLOR_BY_TYPE + textColorMode = COLOR_TEXT + textMode = TEXT_OFF + textPosition = TEXT_POSITION_RIGHT_BELOW + textColor = "1 1 1" + textShadow = TRUE + textFontSize = 12 + showTextOnlyForSelectedMarker = FALSE + cutText = FALSE + maxNumberOfLines = 1 + vectorArrow = VECTOR_END_ARROW + useAntiAlias = FALSE + currentStyleIndex = 4 + depthVectorDrawMode = DRAW_NONE + drawMode = DRAW_MARKER + selectiveDrawing = FALSE + selectionBoxesForCurrentOnly = FALSE + cooperative = FALSE + busy = FALSE + instanceName = SoView2DMarkerEditor + listString = "[(16.5 18.5 0.5) 1 #1, (43.5 27.5 0.5) 2 #2, (54.5 13.5 0.5) 3 #5]" + numItems = 3 + index = 2 + persistent = TRUE + listStringEnable = FALSE + ownsList = TRUE + applySelect = FALSE + id = 5 + name = "" + newName = "" + actionClass = Modify + actionIndex = 2 + actionId = 5 + currentIndex = 2 + overflowMode = None + maxSize = 0 + useInsertTemplate = FALSE + upToDate = TRUE + posXYZ = "54.5 13.5 0.5" + posC = 0 + posT = 0 + posU = 0 + vecXYZ = "0 0 0" + type = 3 + newPosXYZ = "0 0 0" + newPosC = 0 + newPosT = 0 + newPosU = 0 + newVecXYZ = "0 0 0" + newType = 0 + } +} +module View2D { + internal { + frame = "17 265 128 64" + moduleGroupName = "Seed selection" + windows { + window _default { + geometry = "4 30 294 265" + sizeHint = "400 400" + wasOpen = yes + wasActive = no + } + } + } + fields { + instanceName = SeedpointViewer + inventorInputOn = TRUE + view2DExtensionsOn = TRUE + startSlice = 0 + numSlices = 1 + numXSlices = 1 + sliceStep = 1 + slab = 1 + blendMode = BLEND_REPLACE + timePoint = 0 + maxTimePoint = 0 + filterMode = FILTER_LINEAR + standardKeys = TRUE + cineMode = CINE_Z + cineDirection = CINE_PINGPONG + cineRepeat = CINE_ONCE + cineSpeed = 0.1000000015 + snapToCenter = FALSE + zoomMode = VIEW2D_AUTO_ZOOM + unzoomOnImageChange = FALSE + sliceZoom = 1 + sliceZoomSynced = 1 + baseColor = "1 1 1" + margin = "2 2" + sliceOrigin = "0 0" + lutCenter = 1423.000122 + lutWidth = 2365.000244 + lutUseTraceColors = FALSE + annotationOn = TRUE + annotationMode = ANNO_MODE_AUTO + annotationSizeMode = ANNO_SHOW_DETAILED + annotationCol = "0.8999999761581421 0.8999999761581421 0.8999999761581421" + annotationFontSize = ANNO_SIZE_AUTO + annoCoords = Voxel + annoCTValue = AsIs + borderOn = TRUE + borderColor = "0.8999999761581421 0.8999999761581421 0.8999999761581421" + valueHighPrecision = TRUE + maxPrecision = 4 + plane = "0 0 1 0.5" + } + internalFields = "" +} +module FuzzyConnectedness { + internal { + frame = "-123 61 152 56" + moduleGroupName = "" + windows { + window _default { + geometry = "596 466 212 37" + sizeHint = "212 37" + wasOpen = no + wasActive = no + } + } + } + fields { + instanceName = FuzzyConnectedness + autoUpdate = TRUE + } +} +module View2D { + internal { + frame = "-163 -39 120 64" + moduleGroupName = "" + windows { + window _default { + geometry = "6 330 292 283" + sizeHint = "400 400" + wasOpen = yes + wasActive = no + } + } + } + fields { + instanceName = ConnectivityMap + inventorInputOn = FALSE + view2DExtensionsOn = TRUE + startSlice = 0 + numSlices = 1 + numXSlices = 1 + sliceStep = 1 + slab = 1 + blendMode = BLEND_REPLACE + timePoint = 0 + maxTimePoint = 0 + filterMode = FILTER_LINEAR + standardKeys = TRUE + cineMode = CINE_Z + cineDirection = CINE_PINGPONG + cineRepeat = CINE_ONCE + cineSpeed = 0.1000000015 + snapToCenter = FALSE + zoomMode = VIEW2D_AUTO_ZOOM + unzoomOnImageChange = FALSE + sliceZoom = 1 + sliceZoomSynced = 1 + baseColor = "1 1 1" + margin = "2 2" + sliceOrigin = "0 0" + lutCenter = 1084.000122 + lutWidth = 859.1000366 + lutUseTraceColors = FALSE + annotationOn = TRUE + annotationMode = ANNO_MODE_AUTO + annotationSizeMode = ANNO_SHOW_DETAILED + annotationCol = "0.8999999761581421 0.8999999761581421 0.8999999761581421" + annotationFontSize = ANNO_SIZE_AUTO + annoCoords = Voxel + annoCTValue = AsIs + borderOn = TRUE + borderColor = "0.8999999761581421 0.8999999761581421 0.8999999761581421" + valueHighPrecision = FALSE + maxPrecision = 4 + plane = "0 0 1 0.5" + } + internalFields = "" +} +module View2D { + internal { + frame = "-43 -39 88 64" + moduleGroupName = "" + windows { + window _default { + geometry = "5 646 293 302" + sizeHint = "400 400" + wasOpen = yes + wasActive = no + } + } + } + fields { + instanceName = LabelMap + inventorInputOn = FALSE + view2DExtensionsOn = TRUE + startSlice = 0 + numSlices = 1 + numXSlices = 1 + sliceStep = 1 + slab = 1 + blendMode = BLEND_REPLACE + timePoint = 0 + maxTimePoint = 0 + filterMode = FILTER_LINEAR + standardKeys = TRUE + cineMode = CINE_Z + cineDirection = CINE_PINGPONG + cineRepeat = CINE_ONCE + cineSpeed = 0.1000000015 + snapToCenter = FALSE + zoomMode = VIEW2D_AUTO_ZOOM + unzoomOnImageChange = FALSE + sliceZoom = 1 + sliceZoomSynced = 1 + baseColor = "1 1 1" + margin = "2 2" + sliceOrigin = "0 0" + lutCenter = 2.232000113 + lutWidth = 1.169999599 + lutUseTraceColors = FALSE + annotationOn = TRUE + annotationMode = ANNO_MODE_AUTO + annotationSizeMode = ANNO_SHOW_DETAILED + annotationCol = "0.8999999761581421 0.8999999761581421 0.8999999761581421" + annotationFontSize = ANNO_SIZE_AUTO + annoCoords = Voxel + annoCTValue = AsIs + borderOn = TRUE + borderColor = "0.8999999761581421 0.8999999761581421 0.8999999761581421" + valueHighPrecision = FALSE + maxPrecision = 4 + plane = "0 0 1 0.5" + } + internalFields = "" +} +module LocalImage { + internal { + frame = "-167 517 96 56" + moduleGroupName = "" + windows { + window _default { + geometry = "414 413 458 242" + sizeHint = "458 242" + wasOpen = no + wasActive = no + } + } + } + fields { + instanceName = LocalImage + name = $(DemoDataPath)/Bone.tiff + trueName = "C:/Program Files (x86)/MeVisLab2.1aVC9-64/Packages/MeVisLab/Resources/DemoData/Bone.tiff" + autoLoad = TRUE + status = "File open" + } + internalFields = "" +} +connections { + MarkerToMask.input0 = LocalImage.outImage + MarkerToMask.inputXMarkerList = SoView2DMarkerEditor.outXMarkerList + SoView2DMarkerEditor.stylePalette = StylePalette.outStylePalette + SeedpointViewer.inImage = LocalImage.outImage + SeedpointViewer.inInvPreLUT = SoView2DMarkerEditor.self + FuzzyConnectedness.input0 = LocalImage.outImage + FuzzyConnectedness.input1 = MarkerToMask.output0 + ConnectivityMap.inImage = FuzzyConnectedness.output0 + LabelMap.inImage = FuzzyConnectedness.output1 +} +networkModel { + parentItems { + 0 { + MLABNetworkModelItem MLABNetworkModelItemGroup { + uniqueId = 24 + objectName = "Seed selection" + parentUniqueId = 0 + frame = "-8 130 274 376" + color { + r = 45 + g = 226 + b = 226 + a = 40 + } + } + MLABNetworkModelItem MLABNoteItem { + uniqueId = 27 + objectName = "" + parentUniqueId = 0 + frame = "59 -160 254 223" + backgroundColor { + r = 252 + g = 242 + b = 2 + a = 255 + } + text = "Seed points can be set in the SeedpointViewer. Each object may be marked with several seedpoints with the same seed label. The seed label is in this network equal to the CurrentType parameters in the SoView2DMarkerEditor. The numbers 1 to 64 can be used. +The algorithm will start immediately. +The connectivity map and the label map can be seen in the corresponding View2Ds." + titleText = "Fuzzy connectedness example" + isCollapsed = False + } + } + } +} Property changes on: trunk/Community/General/Modules/ML/MLFuzzyConnectedness/networks/MLFuzzyConnectednessExample.mlab ___________________________________________________________________ Added: svn:eol-style + native Added: trunk/Community/General/Sources/ML/MLFuzzyConnectedness/CMIVFuzzyConnectedness.cpp =================================================================== --- trunk/Community/General/Sources/ML/MLFuzzyConnectedness/CMIVFuzzyConnectedness.cpp (rev 0) +++ trunk/Community/General/Sources/ML/MLFuzzyConnectedness/CMIVFuzzyConnectedness.cpp 2009-12-14 13:55:27 UTC (rev 221) @@ -0,0 +1,1244 @@ +/*========================================================================= +Author: Chunliang Wang (chu...@im...) + +Copyright (c) 2007-2009 +Center for Medical Image Science and Visualization (CMIV), +Linköping University, Sweden, http://www.cmiv.liu.se/ +ALL RIGHTS RESERVED + +This image processing plugin from CMIV is free software; +you can redistribute it and/or modify it under the terms of the +GNU Lesser General Public License as published by the Free Software +Foundation, either version 3 of the License, or (at your option) +any later version. + +This image processing plugin is distributed in +the hope that it will be useful, but WITHOUT ANY WARRANTY; +without even the implied warranty of MERCHANTABILITY or FITNESS +FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License +for more details. + +You should have received a copy of the GNU Lesser General Public License +along with this program. If not, see <http://www.gnu.org/licenses/>. +=========================================================================*/ + +#include "CMIVFuzzyConnectedness.h" +#include <string.h> // For memset() + +CMIVFuzzyConnectedness::CMIVFuzzyConnectedness() +{ + imageWidth=0; + imageHeight=0; + imageAmount=0; + imageSize=0; + minmumValue=0.0; + inputData=0L; + outputData=0L; + directionOfData=0L; + colorOfData=0L; +} +void CMIVFuzzyConnectedness::setProperty(long width, long height, long amount, float minval) +{ + + imageWidth=width; + imageHeight=height; + imageAmount=amount; + imageSize=width*height; + minmumValue=minval; + +} + +void CMIVFuzzyConnectedness::startShortestPathSearchAsFloat(float* pIn, float* pOut, unsigned char* pMarker, unsigned char* pPointers) +{ + + long i,j,k; + int changed; + float maxvalue; + unsigned char maxcolorindex; + + + long itemp; + long ilong,iwidth,iheight; + long position_i1,position_i2,position_j1,position_j2,position_j3; + + if(!pMarker || !pIn || !pOut || !pPointers) + return; + + + ilong=imageWidth; + iwidth=imageHeight; + iheight=imageAmount; + + + inputData=pIn; + outputData=pOut; + directionOfData=pPointers; + + unsigned char* marker=pMarker; + long long* longmarker=(long long*)marker; + + //initialize + long tsize=imageSize*imageAmount; + + for(i=0;i<tsize;i++) + { + if(*(marker+i)) + { + if(*(marker+i)<0x40) + { + *(directionOfData+i)=*(marker+i)|0x80; + *(outputData+i) = *(inputData+i); + } + else + { + *(directionOfData+i)=0x80; + *(outputData+i) = minmumValue; + } + } + else + { + *(directionOfData+i)=0x00; + *(outputData+i) = minmumValue; + } + + } + + + runFirstRoundFasterWith26Neigbhorhood(); + + //marker will be borrowed for recording which point has been changed + memset(marker,0xff,imageSize*imageAmount/8+1); + + do + { + changed=0; + +//**********************positive direction***************************** + for(i=1;i<iheight-1;i++) + { + position_i1 = (i-1)*imageSize; + position_i2 = i*imageSize; + + for(j=1;j<iwidth-1;j++) + { + position_j1 = (j-1)*ilong; + position_j2 = j*ilong; + position_j3 = (j+1)*ilong; + + for(k=1;k<ilong-1;k++) + { + itemp= position_i2+position_j2+k; + if(!(*(longmarker+(itemp>>6)))) + { + itemp=itemp>>6; + do + { + itemp++; + }while(!(*(longmarker+itemp))); + itemp=itemp<<6; + k=itemp-position_i2-position_j2; + + if(k>=ilong-1) + continue; + + } + + if(!(*(marker+(itemp>>3)))) + { + itemp=itemp>>3; + do + { + itemp++; + }while(!(*(marker+itemp))); + itemp=itemp<<3; + k=itemp-position_i2-position_j2; + + if(k>=ilong-1) + continue; + + } + + if((*(marker+(itemp>>3)))&(0x01<<(itemp&0x07)))//if this point need to be check again + { + if(*(directionOfData + itemp)&0xc0)//if this is a seed point or saturated point + *(marker+(itemp>>3)) = *(marker+(itemp>>3))&(~(0x01<<(itemp&0x07))); + else + { + //1 + itemp=position_i1+position_j1+k-1; + maxvalue=*(outputData+itemp); + maxcolorindex=1; + //2 + itemp++; + if(*(outputData+itemp)>maxvalue) + { + maxvalue=*(outputData+itemp); + maxcolorindex=2; + } + //3 + itemp++; + if(*(outputData+itemp)>maxvalue) + { + maxvalue=*(outputData+itemp); + maxcolorindex=3; + } + //4 + itemp=position_i1+position_j2+k-1; + if(*(outputData+itemp)>maxvalue) + { + maxvalue=*(outputData+itemp); + maxcolorindex=4; + } + //5 + itemp++; + if(*(outputData+itemp)>maxvalue) + { + maxvalue=*(outputData+itemp); + maxcolorindex=5; + } + + //6 + itemp++; + if(*(outputData+itemp)>maxvalue) + { + maxvalue=*(outputData+itemp); + maxcolorindex=6; + } + //7 + itemp=position_i1+position_j3+k-1; + if(*(outputData+itemp)>maxvalue) + { + maxvalue=*(outputData+itemp); + maxcolorindex=7; + } + //8 + itemp++; + if(*(outputData+itemp)>maxvalue) + { + maxvalue=*(outputData+itemp); + maxcolorindex=8; + } + + //9 + itemp++; + if(*(outputData+itemp)>maxvalue) + { + maxvalue=*(outputData+itemp); + maxcolorindex=9; + } + //10 + itemp=position_i2+position_j1+k-1; + if(*(outputData+itemp)>maxvalue) + { + maxvalue=*(outputData+itemp); + maxcolorindex=10; + } + //11 + itemp++; + if(*(outputData+itemp)>maxvalue) + { + maxvalue=*(outputData+itemp); + maxcolorindex=11; + } + //12 + itemp++; + if(*(outputData+itemp)>maxvalue) + { + maxvalue=*(outputData+itemp); + maxcolorindex=12; + } + //13 + itemp=position_i2+position_j2+k-1; + if(*(outputData+itemp)>maxvalue) + { + maxvalue=*(outputData+itemp); + maxcolorindex=13; + } + //update g + + itemp=position_i2+position_j2+k; + if(maxvalue>*(outputData+itemp)) + { + if(*(inputData+itemp)>*(outputData+itemp)) + { + //*(outputData+itemp)=min(maxvalue,*(inputData+itemp)); + if(maxvalue>*(inputData+itemp)) + { + *(outputData+itemp)=*(inputData+itemp); + *(directionOfData+itemp)=maxcolorindex|0x40; + } + else + { + *(outputData+itemp)=maxvalue; + *(directionOfData+itemp)=maxcolorindex; + } + + int ii,jj,kk; + itemp=position_i1+position_j1+k-1; + for(ii=0;ii<3;ii++) + { + for(jj=0;jj<3;jj++) + { + for(kk=0;kk<3;kk++) + { + + *(marker+(itemp>>3))|=(0x01<<(itemp&0x07)); + itemp++; + } + itemp=itemp-3+ilong; + + } + itemp=itemp-ilong-ilong-ilong+imageSize; + } + + changed++; + } + + else + *(marker+(itemp>>3))&=(~(0x01<<(itemp&0x07))); + + } + else + *(marker+(itemp>>3))&=(~(0x01<<(itemp&0x07))); + + } + } + } + } + } + +//*******************************negitive direction************************* + for(i=iheight-2;i>0;i--) + { + position_i1 = (i+1)*imageSize; + position_i2 = i*imageSize; + + for(j=iwidth-2;j>0;j--) + { + position_j1 = (j-1)*ilong; + position_j2 = j*ilong; + position_j3 = (j+1)*ilong; + + for(k=ilong-2;k>0;k--) + { + itemp= position_i2+position_j2+k; + + + if(!(*(longmarker+(itemp>>6)))) + { + itemp=itemp>>6; + do + { + itemp--; + }while(!(*(longmarker+itemp))); + + itemp=(itemp<<6)+63; + k=itemp-position_i2-position_j2; + + if(k<1) + continue; + + } + + if(!(*(marker+(itemp>>3)))) + { + itemp=itemp>>3; + do + { + itemp--; + }while(!(*(marker+itemp))); + itemp=(itemp<<3)+7; + k=itemp-position_i2-position_j2; + + if(k<1) + continue; + + } + if((*(marker+(itemp>>3)))&(0x01<<(itemp&0x07)))//if this point need to be check again + { + if(*(directionOfData + itemp)&0xc0)//if this is a seed point or saturated point + *(marker+(itemp>>3))=*(marker+(itemp>>3))&(~(0x01<<(itemp&0x07))); + else + { + //1 + itemp=position_i1+position_j3+k+1; + maxvalue=*(outputData+itemp); + maxcolorindex=27; + //2 + itemp--; + if(*(outputData+itemp)>maxvalue) + { + maxvalue=*(outputData+itemp); + maxcolorindex=26; + } + //3 + itemp--; + if(*(outputData+itemp)>maxvalue) + { + maxvalue=*(outputData+itemp); + maxcolorindex=25; + } + //4 + itemp=position_i1+position_j2+k+1; + if(*(outputData+itemp)>maxvalue) + { + maxvalue=*(outputData+itemp); + maxcolorindex=24; + } + //5 + itemp--; + if(*(outputData+itemp)>maxvalue) + { + maxvalue=*(outputData+itemp); + maxcolorindex=23; + } + + //6 + itemp--; + if(*(outputData+itemp)>maxvalue) + { + maxvalue=*(outputData+itemp); + maxcolorindex=22; + } + //7 + itemp=position_i1+position_j1+k+1; + if(*(outputData+itemp)>maxvalue) + { + maxvalue=*(outputData+itemp); + maxcolorindex=21; + } + //8 + itemp--; + if(*(outputData+itemp)>maxvalue) + { + maxvalue=*(outputData+itemp); + maxcolorindex=20; + } + //9 + itemp--; + if(*(outputData+itemp)>maxvalue) + { + maxvalue=*(outputData+itemp); + maxcolorindex=19; + } + //10 + itemp=position_i2+position_j3+k+1; + if(*(outputData+itemp)>maxvalue) + { + maxvalue=*(outputData+itemp); + maxcolorindex=18; + } + //11 + itemp--; + if(*(outputData+itemp)>maxvalue) + { + maxvalue=*(outputData+itemp); + maxcolorindex=17; + } + //12 + itemp--; + if(*(outputData+itemp)>maxvalue) + { + maxvalue=*(outputData+itemp); + maxcolorindex=16; + } + //13 + itemp=position_i2+position_j2+k+1; + if(*(outputData+itemp)>maxvalue) + { + maxvalue=*(outputData+itemp); + maxcolorindex=15; + } + //update g + + itemp=position_i2+position_j2+k; + if(maxvalue>*(outputData+itemp)) + { + if(*(inputData+itemp)>*(outputData+itemp)) + { + //*(outputData+itemp)=min(maxvalue,*(inputData+itemp)); + if(maxvalue>*(inputData+itemp)) + { + *(outputData+itemp)=*(inputData+itemp); + *(directionOfData+itemp)=maxcolorindex|0x40; + } + else + { + *(outputData+itemp)=maxvalue; + *(directionOfData+itemp)=maxcolorindex; + } + + int ii,jj,kk; + itemp=position_i2-imageSize+position_j1+k-1; + for(ii=0;ii<3;ii++) + { + for(jj=0;jj<3;jj++) + { + for(kk=0;kk<3;kk++) + { + + *(marker+(itemp>>3))|=(0x01<<(itemp&0x07)); + itemp++; + } + itemp=itemp-3+ilong; + + } + itemp=itemp-ilong-ilong-ilong+imageSize; + } + + changed++; + } + else + *(marker+(itemp>>3))&=(~(0x01<<(itemp&0x07))); + + + } + else + *(marker+(itemp>>3))&=(~(0x01<<(itemp&0x07))); + + } + } + } + } + } + + }while(changed); + + checkSaturatedPoints(); + memset(pMarker,0x00,imageSize*imageAmount); + caculateColorMapFromPointerMap(pMarker, pPointers); +} +void CMIVFuzzyConnectedness::runFirstRoundFasterWith26Neigbhorhood() +{ + + long i,j,k; + float maxvalue; + unsigned char maxcolorindex; + long itemp; + long ilong,iwidth,iheight; + long position_i1,position_i2,position_j1,position_j2,position_j3; + int countNum=0; + + + ilong=imageWidth; + iwidth=imageHeight; + iheight=imageAmount; + + + + + //**********************positive direction***************************** + + + for(i=1;i<iheight-1;i++) + { + position_i1 = (i-1)*imageSize; + position_i2 = i*imageSize; + + for(j=1;j<iwidth-1;j++) + { + position_j1 = (j-1)*ilong; + position_j2 = j*ilong; + position_j3 = (j+1)*ilong; + for(k=1;k<ilong-1;k++) + if(!(*(directionOfData + position_i2+position_j2+k)&0xc0)) + { + countNum++; + //1 + itemp=position_i1+position_j1+k-1; + maxvalue=*(outputData+itemp); + maxcolorindex=1; + //2 + itemp++; + if(*(outputData+itemp)>maxvalue) + { + maxvalue=*(outputData+itemp); + maxcolorindex=2; + } + //3 + itemp++; + if(*(outputData+itemp)>maxvalue) + { + maxvalue=*(outputData+itemp); + maxcolorindex=3; + } + //4 + itemp=position_i1+position_j2+k-1; + if(*(outputData+itemp)>maxvalue) + { + maxvalue=*(outputData+itemp); + maxcolorindex=4; + } + //5 + itemp++; + if(*(outputData+itemp)>maxvalue) + { + maxvalue=*(outputData+itemp); + maxcolorindex=5; + } + + //6 + itemp++; + if(*(outputData+itemp)>maxvalue) + { + maxvalue=*(outputData+itemp); + maxcolorindex=6; + } + //7 + itemp=position_i1+position_j3+k-1; + if(*(outputData+itemp)>maxvalue) + { + maxvalue=*(outputData+itemp); + maxcolorindex=7; + } + //8 + itemp++; + if(*(outputData+itemp)>maxvalue) + { + maxvalue=*(outputData+itemp); + maxcolorindex=8; + } + + //9 + itemp++; + if(*(outputData+itemp)>maxvalue) + { + maxvalue=*(outputData+itemp); + maxcolorindex=9; + } + //10 + itemp=position_i2+position_j1+k-1; + if(*(outputData+itemp)>maxvalue) + { + maxvalue=*(outputData+itemp); + maxcolorindex=10; + } + //11 + itemp++; + if(*(outputData+itemp)>maxvalue) + { + maxvalue=*(outputData+itemp); + maxcolorindex=11; + } + //12 + itemp++; + if(*(outputData+itemp)>maxvalue) + { + maxvalue=*(outputData+itemp); + maxcolorindex=12; + } + //13 + itemp=position_i2+position_j2+k-1; + if(*(outputData+itemp)>maxvalue) + { + maxvalue=*(outputData+itemp); + maxcolorindex=13; + } + //update g + itemp=position_i2+position_j2+k; + if(maxvalue>*(outputData+itemp)) + { + if(*(inputData+itemp)>*(outputData+itemp)) + { + //*(outputData+itemp)=min(maxvalue,*(inputData+itemp)); + if(maxvalue>*(inputData+itemp)) + { + *(outputData+itemp)=*(inputData+itemp); + *(directionOfData+itemp)=maxcolorindex|0x40; + } + else + { + *(outputData+itemp)=maxvalue; + *(directionOfData+itemp)=maxcolorindex; + } + + + } + + } + + } + } + } + countNum=0; + + //*******************************negitive direction************************* + for(i=iheight-2;i>0;i--) + { + position_i1 = (i+1)*imageSize; + position_i2 = i*imageSize; + + for(j=iwidth-2;j>0;j--) + { + position_j1 = (j-1)*ilong; + position_j2 = j*ilong; + position_j3 = (j+1)*ilong; + + for(k=ilong-2;k>0;k--) + if(!(*(directionOfData + position_i2+position_j2+k)&0xc0)) + { + countNum++; + //1 + itemp=position_i1+position_j3+k+1; + maxvalue=*(outputData+itemp); + maxcolorindex=27; + //2 + itemp--; + if(*(outputData+itemp)>maxvalue) + { + maxvalue=*(outputData+itemp); + maxcolorindex=26; + } + //3 + itemp--; + if(*(outputData+itemp)>maxvalue) + { + maxvalue=*(outputData+itemp); + maxcolorindex=25; + } + //4 + itemp=position_i1+position_j2+k+1; + if(*(outputData+itemp)>maxvalue) + { + maxvalue=*(outputData+itemp); + maxcolorindex=24; + } + //5 + itemp--; + if(*(outputData+itemp)>maxvalue) + { + maxvalue=*(outputData+itemp); + maxcolorindex=23; + } + + //6 + itemp--; + if(*(outputData+itemp)>maxvalue) + { + maxvalue=*(outputData+itemp); + maxcolorindex=22; + } + //7 + itemp=position_i1+position_j1+k+1; + if(*(outputData+itemp)>maxvalue) + { + maxvalue=*(outputData+itemp); + maxcolorindex=21; + } + //8 + itemp--; + if(*(outputData+itemp)>maxvalue) + { + maxvalue=*(outputData+itemp); + maxcolorindex=20; + } + //9 + itemp--; + if(*(outputData+itemp)>maxvalue) + { + maxvalue=*(outputData+itemp); + maxcolorindex=19; + } + //10 + itemp=position_i2+position_j3+k+1; + if(*(outputData+itemp)>maxvalue) + { + maxvalue=*(outputData+itemp); + maxcolorindex=18; + } + //11 + itemp--; + if(*(outputData+itemp)>maxvalue) + { + maxvalue=*(outputData+itemp); + maxcolorindex=17; + } + //12 + itemp--; + if(*(outputData+itemp)>maxvalue) + { + maxvalue=*(outputData+itemp); + maxcolorindex=16; + } + //13 + itemp=position_i2+position_j2+k+1; + if(*(outputData+itemp)>maxvalue) + { + maxvalue=*(outputData+itemp); + maxcolorindex=15; + } + //update g + + itemp=position_i2+position_j2+k; + if(maxvalue>*(outputData+itemp)) + { + //*(outputData+itemp)=min(maxvalue,*(inputData+itemp)); + if(maxvalue>*(inputData+itemp)) + { + *(outputData+itemp)=*(inputData+itemp); + *(directionOfData+itemp)=maxcolorindex|0x40; + } + else + { + *(outputData+itemp)=maxvalue; + *(directionOfData+itemp)=maxcolorindex; + } + + + } + + + } + } + } + countNum++; + + +} +void CMIVFuzzyConnectedness::checkSaturatedPoints() +{ + long i,j,k; + float maxvalue, oldmaxvalue; + unsigned char maxcolorindex,oldcolorindex; + long itemp; + long ilong,iwidth,iheight; + long position_i1,position_i2,position_i3,position_j1,position_j2,position_j3; + ilong=imageWidth; + iwidth=imageHeight; + iheight=imageAmount; + + + for(i=1;i<iheight-1;i++) + { + position_i1 = (i-1)*imageSize; + position_i2 = i*imageSize; + position_i3 = (i+1)*imageSize; + for(j=1;j<iwidth-1;j++) + { + position_j1 = (j-1)*ilong; + position_j2 = j*ilong; + position_j3 = (j+1)*ilong; + for(k=1;k<ilong-1;k++) + if((!(*(directionOfData + position_i2+position_j2+k)&0x80))&&(*(directionOfData + position_i2+position_j2+k)&0x40)) + { + oldcolorindex=*(directionOfData + position_i2+position_j2+k)&0x3f; + + //1 + itemp=position_i1+position_j1+k-1; + maxvalue=*(outputData+itemp); + maxcolorindex=1; + oldmaxvalue=maxvalue; + //2 + itemp++; + if(*(outputData+itemp)>maxvalue) + { + maxvalue=*(outputData+itemp); + maxcolorindex=2; + } + if(oldcolorindex==2) + oldmaxvalue=*(outputData+itemp); + //3 + itemp++; + if(*(outputData+itemp)>maxvalue) + { + maxvalue=*(outputData+itemp); + maxcolorindex=3; + } + if(oldcolorindex==3) + oldmaxvalue=*(outputData+itemp); + //4 + itemp=position_i1+position_j2+k-1; + if(*(outputData+itemp)>maxvalue) + { + maxvalue=*(outputData+itemp); + maxcolorindex=4; + } + if(oldcolorindex==4) + oldmaxvalue=*(outputData+itemp); + //5 + itemp++; + if(*(outputData+itemp)>maxvalue) + { + maxvalue=*(outputData+itemp); + maxcolorindex=5; + } + if(oldcolorindex==5) + oldmaxvalue=*(outputData+itemp); + //6 + itemp++; + if(*(outputData+itemp)>maxvalue) + { + maxvalue=*(outputData+itemp); + maxcolorindex=6; + } + if(oldcolorindex==6) + oldmaxvalue=*(outputData+itemp); + //7 + itemp=position_i1+position_j3+k-1; + if(*(outputData+itemp)>maxvalue) + { + maxvalue=*(outputData+itemp); + maxcolorindex=7; + } + if(oldcolorindex==7) + oldmaxvalue=*(outputData+itemp); + //8 + itemp++; + if(*(outputData+itemp)>maxvalue) + { + maxvalue=*(outputData+itemp); + maxcolorindex=8; + } + if(oldcolorindex==8) + oldmaxvalue=*(outputData+itemp); + //9 + itemp++; + if(*(outputData+itemp)>maxvalue) + { + maxvalue=*(outputData+itemp); + maxcolorindex=9; + } + if(oldcolorindex==9) + oldmaxvalue=*(outputData+itemp); + //10 + itemp=position_i2+position_j1+k-1; + if(*(outputData+itemp)>maxvalue) + { + maxvalue=*(outputData+itemp); + maxcolorindex=10; + } + if(oldcolorindex==10) + oldmaxvalue=*(outputData+itemp); + //11 + itemp++; + if(*(outputData+itemp)>maxvalue) + { + maxvalue=*(outputData+itemp); + maxcolorindex=11; + } + if(oldcolorindex==11) + oldmaxvalue=*(outputData+itemp); + //12 + itemp++; + if(*(outputData+itemp)>maxvalue) + { + maxvalue=*(outputData+itemp); + maxcolorindex=12; + } + if(oldcolorindex==12) + oldmaxvalue=*(outputData+itemp); + //13 + itemp=position_i2+position_j2+k-1; + if(*(outputData+itemp)>maxvalue) + { + maxvalue=*(outputData+itemp); + maxcolorindex=13; + } + if(oldcolorindex==13) + oldmaxvalue=*(outputData+itemp); + //15 + itemp+=2; + if(*(outputData+itemp)>maxvalue) + { + maxvalue=*(outputData+itemp); + maxcolorindex=15; + } + if(oldcolorindex==15) + oldmaxvalue=*(outputData+itemp); + //16 + itemp=position_i2+position_j3+k-1; + if(*(outputData+itemp)>maxvalue) + { + maxvalue=*(outputData+itemp); + maxcolorindex=16; + } + if(oldcolorindex==16) + oldmaxvalue=*(outputData+itemp); + //17 + itemp++; + if(*(outputData+itemp)>maxvalue) + { + maxvalue=*(outputData+itemp); + maxcolorindex=17; + } + if(oldcolorindex==17) + oldmaxvalue=*(outputData+itemp); + //18 + itemp++; + if(*(outputData+itemp)>maxvalue) + { + maxvalue=*(outputData+itemp); + maxcolorindex=18; + } + if(oldcolorindex==18) + oldmaxvalue=*(outputData+itemp); + //19 + itemp=position_i3+position_j1+k-1; + if(*(outputData+itemp)>maxvalue) + { + maxvalue=*(outputData+itemp); + maxcolorindex=19; + } + if(oldcolorindex==19) + oldmaxvalue=*(outputData+itemp); + //20 + itemp++; + if(*(outputData+itemp)>maxvalue) + { + maxvalue=*(outputData+itemp); + maxcolorindex=20; + } + if(oldcolorindex==20) + oldmaxvalue=*(outputData+itemp); + //21 + itemp++; + if(*(outputData+itemp)>maxvalue) + { + maxvalue=*(outputData+itemp); + maxcolorindex=21; + } + if(oldcolorindex==21) + oldmaxvalue=*(outputData+itemp); + //22 + itemp=position_i3+position_j2+k-1; + if(*(outputData+itemp)>maxvalue) + { + maxvalue=*(outputData+itemp); + maxcolorindex=22; + } + if(oldcolorindex==22) + oldmaxvalue=*(outputData+itemp); + //23 + itemp++; + if(*(outputData+itemp)>maxvalue) + { + maxvalue=*(outputData+itemp); + maxcolorindex=23; + } + if(oldcolorindex==23) + oldmaxvalue=*(outputData+itemp); + //24 + itemp++; + if(*(outputData+itemp)>maxvalue) + { + maxvalue=*(outputData+itemp); + maxcolorindex=24; + } + if(oldcolorindex==24) + oldmaxvalue=*(outputData+itemp); + //25 + itemp=position_i3+position_j3+k-1; + if(*(outputData+itemp)>maxvalue) + { + maxvalue=*(outputData+itemp); + maxcolorindex=25; + } + if(oldcolorindex==25) + oldmaxvalue=*(outputData+itemp); + //26 + itemp++; + if(*(outputData+itemp)>maxvalue) + { + maxvalue=*(outputData+itemp); + maxcolorindex=26; + } + if(oldcolorindex==26) + oldmaxvalue=*(outputData+itemp); + //27 + itemp++; + if(*(outputData+itemp)>maxvalue) + { + maxvalue=*(outputData+itemp); + maxcolorindex=27; + } + if(oldcolorindex==27) + oldmaxvalue=*(outputData+itemp); + //update direction + itemp=position_i2+position_j2+k; + if(maxvalue>oldmaxvalue) + *(directionOfData+itemp)=maxcolorindex; + else + *(directionOfData+itemp)=oldcolorindex; + + + + } + } + } + + +} + +void CMIVFuzzyConnectedness::caculateColorMapFromPointerMap(unsigned char* pColor, unsigned char* pPointers) +{ + colorOfData=pColor; + directionOfData=pPointers; + int totalvoxel=imageSize*(imageAmount-1); + int i; + for(i=imageSize;i<totalvoxel;i++) + { + + if(*(colorOfData+i)==0) + { + if(!((*(directionOfData+i))&0x80)) + { + int direction=*(directionOfData+i)&0x3f; + if(direction) + { + int itemp=0; + switch(direction) + { + case 1: itemp = (-imageSize-imageWidth-1); + break; + case 2: itemp = (-imageSize-imageWidth); + break; + case 3: itemp = (-imageSize-imageWidth+1); + break; + case 4: itemp = (-imageSize-1); + break; + case 5: itemp = (-imageSize); + break; + case 6: itemp = (-imageSize+1); + break; + case 7: itemp = (-imageSize+imageWidth-1); + break; + case 8: itemp = (-imageSize+imageWidth); + break; + case 9: itemp = (-imageSize+imageWidth+1); + break; + case 10: itemp = (-imageWidth-1); + break; + case 11: itemp = (-imageWidth); + break; + case 12: itemp = (-imageWidth+1); + break; + case 13: itemp = (-1); + break; + case 14: itemp = 0; + break; + case 15: itemp = 1; + break; + case 16: itemp = imageWidth-1; + break; + case 17: itemp = imageWidth; + break; + case 18: itemp = imageWidth+1; + break; + case 19: itemp = imageSize-imageWidth-1; + break; + case 20: itemp = imageSize-imageWidth; + break; + case 21: itemp = imageSize-imageWidth+1; + break; + case 22: itemp = imageSize-1; + break; + case 23: itemp = imageSize; + break; + case 24: itemp = imageSize+1; + break; + case 25: itemp = imageSize+imageWidth-1; + break;... [truncated message content] |
From: <bar...@us...> - 2009-12-10 12:49:44
|
Revision: 220 http://mevislabmodules.svn.sourceforge.net/mevislabmodules/?rev=220&view=rev Author: bartdedobbelaer Date: 2009-12-10 12:49:35 +0000 (Thu, 10 Dec 2009) Log Message: ----------- - Added image and voxel dimensions to output of AnalyzeHeader Modified Paths: -------------- trunk/Community/General/Modules/ML/MLImageUtilities/MLImageUtilities.def trunk/Community/General/Sources/ML/MLImageUtilities/AnalyzeHeader/AnalyzeHeader.cpp trunk/Community/General/Sources/ML/MLImageUtilities/AnalyzeHeader/AnalyzeHeader.h Modified: trunk/Community/General/Modules/ML/MLImageUtilities/MLImageUtilities.def =================================================================== --- trunk/Community/General/Modules/ML/MLImageUtilities/MLImageUtilities.def 2009-11-18 13:21:19 UTC (rev 219) +++ trunk/Community/General/Modules/ML/MLImageUtilities/MLImageUtilities.def 2009-12-10 12:49:35 UTC (rev 220) @@ -61,6 +61,9 @@ Field funused1 { edit = NO minLength = 10 } Field funused2 { edit = NO minLength = 10 } Field funused3 { edit = NO minLength = 10 } + Separator { direction = Horizontal } + Field dimensions { edit = NO minLength = 10 } + Field voxelSize { edit = NO minLength = 10 } } } } // MLModule AnalyzeHeader Modified: trunk/Community/General/Sources/ML/MLImageUtilities/AnalyzeHeader/AnalyzeHeader.cpp =================================================================== --- trunk/Community/General/Sources/ML/MLImageUtilities/AnalyzeHeader/AnalyzeHeader.cpp 2009-11-18 13:21:19 UTC (rev 219) +++ trunk/Community/General/Sources/ML/MLImageUtilities/AnalyzeHeader/AnalyzeHeader.cpp 2009-12-10 12:49:35 UTC (rev 220) @@ -28,10 +28,12 @@ (_filenameFld = getFieldContainer()->addString("filename"))->setStringValue(""); - (_funused1Fld = getFieldContainer()->addFloat("funused1"))->setFloatValue(0.0f); (_funused2Fld = getFieldContainer()->addFloat("funused2"))->setFloatValue(0.0f); (_funused3Fld = getFieldContainer()->addFloat("funused3"))->setFloatValue(0.0f); + + (_dimensionsFld = getFieldContainer()->addVec4f("dimensions"))->setVec4fValue(vec4(0.0f,0.0f,0.0f,0.0f)); + (_voxelSizeFld = getFieldContainer()->addVec4f("voxelSize"))->setVec4fValue(vec4(0.0f,0.0f,0.0f,0.0f)); handleNotificationOn(); } @@ -78,7 +80,7 @@ FILE *file; int nr,i; - unsigned short d[3]; + unsigned short d[8]; bool swapendian; int hdrsize,extents,glmax,glmin,views,vols_added,start_field,field_skip,omax, @@ -89,8 +91,11 @@ unsigned short session_error,unused1,datatypean,bitpix,dim_un0,origin[5]; float pixdim[8],vox_offset,cal_max,cal_min,compressed,verified; - float funused1 = 0.0f, funused2 = 0.0f, funused3 = 0.0f; + for (i = 0;i < 8; i ++) { + d[i] = 0; + pixdim[i] = 0.0f; + } file=fopen(filename,"rb"); @@ -110,16 +115,10 @@ fread(&extents,4,1,file);if (swapendian) swap(&extents,4); fread(&session_error,2,1,file);if (swapendian) swap(&session_error,2); fread(®ular,1,1,file); - fread(&hkey_un0,1,1,file); - - fseek(file,2,SEEK_CUR);//skip two bytes - fread(&d[0],2,1,file);if (swapendian) swap(&d[0],2); - fread(&d[1],2,1,file);if (swapendian) swap(&d[1],2); - fread(&d[2],2,1,file);if (swapendian) swap(&d[2],2); - //dim[0]=d[0]; - //dim[1]=d[1]; - //dim[2]=d[2]; - fseek(file,8,SEEK_CUR);//skip eight bytes + fread(&hkey_un0,1,1,file); + for (i=0;i<8;i++) { + fread(&d[i],2,1,file);if (swapendian) swap(&d[i],2); + } fread(&vox_units[0],4,1,file); fread(&cal_units[0],8,1,file); fread(&unused1,2,1,file);if (swapendian) swap(&unused1,2); @@ -129,9 +128,6 @@ for (i=0;i<8;i++) { fread(&pixdim[i],4,1,file);if (swapendian) swap(&pixdim[i],4); } - //voxdim[0]=pixdim[1]; - //voxdim[1]=pixdim[2]; - //voxdim[2]=pixdim[3]; fread(&vox_offset,4,1,file);if (swapendian) swap(&vox_offset,4); fread(&funused1,4,1,file);if (swapendian) swap(&funused1,4); fread(&funused2,4,1,file);if (swapendian) swap(&funused2,4); @@ -168,14 +164,14 @@ fclose(file); } - _funused1Fld->setFloatValue(funused1); _funused2Fld->setFloatValue(funused2); _funused3Fld->setFloatValue(funused3); + _dimensionsFld->setVec4fValue(vec4(d[1],d[2],d[3],d[4])); + _voxelSizeFld->setVec4fValue(vec4(pixdim[1],pixdim[2],pixdim[3],pixdim[4])); - - } + BaseOp::handleNotification(field); } Modified: trunk/Community/General/Sources/ML/MLImageUtilities/AnalyzeHeader/AnalyzeHeader.h =================================================================== --- trunk/Community/General/Sources/ML/MLImageUtilities/AnalyzeHeader/AnalyzeHeader.h 2009-11-18 13:21:19 UTC (rev 219) +++ trunk/Community/General/Sources/ML/MLImageUtilities/AnalyzeHeader/AnalyzeHeader.h 2009-12-10 12:49:35 UTC (rev 220) @@ -37,6 +37,8 @@ private: StringField *_filenameFld; + Vec4fField *_dimensionsFld; + Vec4fField *_voxelSizeFld; FloatField *_funused1Fld; FloatField *_funused2Fld; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bar...@us...> - 2009-11-18 13:21:27
|
Revision: 219 http://mevislabmodules.svn.sourceforge.net/mevislabmodules/?rev=219&view=rev Author: bartdedobbelaer Date: 2009-11-18 13:21:19 +0000 (Wed, 18 Nov 2009) Log Message: ----------- - Small typo - Added comments about linux compilation Modified Paths: -------------- trunk/Community/General/Sources/ML/MLMatlabScriptWrapper/README.txt Modified: trunk/Community/General/Sources/ML/MLMatlabScriptWrapper/README.txt =================================================================== --- trunk/Community/General/Sources/ML/MLMatlabScriptWrapper/README.txt 2009-11-18 10:52:20 UTC (rev 218) +++ trunk/Community/General/Sources/ML/MLMatlabScriptWrapper/README.txt 2009-11-18 13:21:19 UTC (rev 219) @@ -15,7 +15,7 @@ as compiler. Steps 2 and 3 describe the compile process under Windows. Similar steps are -required for Windows or Linux. +required for Mac OS X or Linux. 2. In the MLMatlabScriptWrapper.pro file, the path to the Matlab libraries must be set. For this, you will need to locate the required Matlab *.lib files. For example, @@ -52,6 +52,7 @@ If the module is still red, the DependencyWalker program can be used to find out which DLL-files that are missing. If you have DependencyWalker installed, it can be executed by right-clicking on the red MatlabScriptWrapper module in MeVisLab and then choosing "Debugging"->"Show DLL Dependency" + On Linux this can be done with /usr/bin/ldd If you experience troubles, please search the MeVisLab forum http://www.mevis-research.de/cgi-bin/discus/discus.cgi @@ -59,4 +60,8 @@ General hints: -- Under Windows, you may have to execute the command "matlab \regserver" from a Windows command prompt (not the Matlab prompt!). \ No newline at end of file +- Under Windows, you may have to execute the command "matlab \regserver" from a Windows command prompt (not the Matlab prompt!). +- Under Linux you need to set your LD_LIBRARY_PATH to include the matlab directories before you run MeVisLab: + setenv LD_LIBRARY_PATH ${MATLAB_ROOT}/bin/glnxa64/:$LD_LIBRARY_PATH + Replace ${MATLAB_ROOT} with the directory where matlab is installed. Use /bin/glnx86/ for the 32 bit version. + Should the module still be red also add ${MATLAB_ROOT}/sys/os/glnxa64/ to your LD_LIBRARY_PATH. \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <of...@us...> - 2009-11-18 10:52:36
|
Revision: 218 http://mevislabmodules.svn.sourceforge.net/mevislabmodules/?rev=218&view=rev Author: ofriman Date: 2009-11-18 10:52:20 +0000 (Wed, 18 Nov 2009) Log Message: ----------- Updated compile instructions. Modified Paths: -------------- trunk/Community/General/Sources/ML/MLMatlabScriptWrapper/README.txt Modified: trunk/Community/General/Sources/ML/MLMatlabScriptWrapper/README.txt =================================================================== --- trunk/Community/General/Sources/ML/MLMatlabScriptWrapper/README.txt 2009-11-17 18:00:35 UTC (rev 217) +++ trunk/Community/General/Sources/ML/MLMatlabScriptWrapper/README.txt 2009-11-18 10:52:20 UTC (rev 218) @@ -14,8 +14,6 @@ If you use Windows, the free Visual Studio Express version may be used as compiler. - Problems have been reported using the MatlabScriptWrapper module with Matlab 2009. - Steps 2 and 3 describe the compile process under Windows. Similar steps are required for Windows or Linux. @@ -39,10 +37,22 @@ scanned by inspecting the Debug Output window. 5. When the MatlabScriptWrapper module is dragged onto the MeVisLab workspace, a Matlab session should start - and a Matlab console window appear. If the module is red, make sure that you started the Release mode of - MeVisLab if you compiled in release mode, or in Debug mode if you compiled in debug mode. If the module - is still red, the DependencyWalker program can be used to find out which DLL-files that are missing. + and a Matlab console window appear. If the module is red, the correct DLL files are not found or loaded. + Check the following: + - That you started the Release mode of MeVisLab if you compiled in release mode, + or in Debug mode if you compiled in debug mode. + - That the path to the Matlab DLL-files is known to the system. Under Windows, you may have to modify the + PATH environment variable manually (this has been reported with the Matlab 2009 versions). The Matlab + DLL files are found in a subdirectory in the $MATLABROOT$/bin/ directory, e.g., in + C:\Program Files\MATLAB\R2007b\bin\win32 + Make sure that this directory is in the PATH environment variable and restart MeVisLab after the PATH variable + has been changed. + + If the module is still red, the DependencyWalker program can be used to find out which DLL-files that are missing. + If you have DependencyWalker installed, it can be executed by right-clicking on the red MatlabScriptWrapper module + in MeVisLab and then choosing "Debugging"->"Show DLL Dependency" + If you experience troubles, please search the MeVisLab forum http://www.mevis-research.de/cgi-bin/discus/discus.cgi This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <of...@us...> - 2009-11-17 18:00:53
|
Revision: 217 http://mevislabmodules.svn.sourceforge.net/mevislabmodules/?rev=217&view=rev Author: ofriman Date: 2009-11-17 18:00:35 +0000 (Tue, 17 Nov 2009) Log Message: ----------- Made a few changes to make it clearer how to set the paths in the .pro file. Added a README.txt file that describes the compilation process. Modified Paths: -------------- trunk/Community/General/Sources/ML/MLMatlabScriptWrapper/MLMatlabScriptWrapper.pro trunk/Community/General/Sources/ML/MLMatlabScriptWrapper/mlMatlabScriptWrapper.h Added Paths: ----------- trunk/Community/General/Sources/ML/MLMatlabScriptWrapper/README.txt Modified: trunk/Community/General/Sources/ML/MLMatlabScriptWrapper/MLMatlabScriptWrapper.pro =================================================================== --- trunk/Community/General/Sources/ML/MLMatlabScriptWrapper/MLMatlabScriptWrapper.pro 2009-11-11 09:03:42 UTC (rev 216) +++ trunk/Community/General/Sources/ML/MLMatlabScriptWrapper/MLMatlabScriptWrapper.pro 2009-11-17 18:00:35 UTC (rev 217) @@ -24,8 +24,17 @@ # make sure that this file is included after CONFIG and MLAB_PACKAGES include ($(MLAB_MeVis_Foundation)/Configuration/IncludePackages.pri) + +# --------- CHANGE PATHS TO MATLAB FILES HERE --------- +# path to the Matlab *.lib files +MATLAB_LIBDIR = "C:/Program Files/MATLAB/R2007b/extern/lib/win32/microsoft" + +# add path to the Matlab engine.h file +INCLUDEPATH += "C:/Program Files/MATLAB/R2007b/extern/include" +# ----------------------------------------------------- + win64 { - QMAKE_LIBDIR += "$$(MLAB_MeVisResearch_General)"/Sources/ML/MLMatlabScriptWrapper/MatlabCommon/win64 + QMAKE_LIBDIR += $${MATLAB_LIBDIR} LIBS += libeng.lib LIBS += libmat.lib @@ -36,7 +45,7 @@ LIBS += libmx.lib } else:win32 { - QMAKE_LIBDIR += "$$(MLAB_MeVisResearch_General)"/Sources/ML/MLMatlabScriptWrapper/MatlabCommon/win32 + QMAKE_LIBDIR += $${MATLAB_LIBDIR} LIBS += libdflapack.lib LIBS += libeng.lib @@ -46,8 +55,6 @@ LIBS += libmx.lib } else:macx { - MATLAB_LIBDIR = "$$(MLAB_MeVisResearch_General)"/Sources/ML/MLMatlabScriptWrapper/MatlabCommon/macos - LIBS += $${MATLAB_LIBDIR}/libeng.dylib LIBS += $${MATLAB_LIBDIR}/libmx.dylib LIBS += $${MATLAB_LIBDIR}/libut.dylib @@ -61,7 +68,7 @@ LIBS += $${MATLAB_LIBDIR}/libz.1.dylib } else:linux { - QMAKE_LIBDIR += "$$(MLAB_MeVisResearch_General)"/Sources/ML/MLMatlabScriptWrapper/MatlabCommon/linux + QMAKE_LIBDIR += $${MATLAB_LIBDIR} LIBS += -lut LIBS += -leng Added: trunk/Community/General/Sources/ML/MLMatlabScriptWrapper/README.txt =================================================================== --- trunk/Community/General/Sources/ML/MLMatlabScriptWrapper/README.txt (rev 0) +++ trunk/Community/General/Sources/ML/MLMatlabScriptWrapper/README.txt 2009-11-17 18:00:35 UTC (rev 217) @@ -0,0 +1,52 @@ +The MatlabScriptWrapper module makes it possible to execute Matlab scripts within +the MeVisLab environment, and it provides an interface to transfer data between +MeVisLab and Matlab. Matlab must be installed for this module to work. Furthermore, +as the MatlabScriptWrapper must be linked against the installed Matlab version, +there is no binary version of this module. This means that you must compile the +MatlabScriptWrapper yourself. The basic steps for doing this are explained below. + +1. The following components must be installed on your system: + - An SDK version of MeVisLab (available at www.mevislab.de) + - A C++ compiler, e.g., Visual Studio for Windows or gcc for Linux. + - Python 2.5 (Python 3.0 or higher will not work). + - A local installation of Matlab. + + If you use Windows, the free Visual Studio Express version may be used + as compiler. + + Problems have been reported using the MatlabScriptWrapper module with Matlab 2009. + +Steps 2 and 3 describe the compile process under Windows. Similar steps are +required for Windows or Linux. + +2. In the MLMatlabScriptWrapper.pro file, the path to the Matlab libraries must be set. + For this, you will need to locate the required Matlab *.lib files. For example, + for a 64-bit Windows version of Matlab 2007b installed under "C:/Program Files/MATLAB", + the following path must be set: + + MATLAB_LIBDIR = "C:/Program Files/MATLAB/R2007b/extern/lib/win64/microsoft" + + In addition, the path to the engine.h file must be added. For the above example, this is done with + the following line + + INCLUDEPATH += "C:/Program Files/MATLAB/R2007b/extern/include" + +3. Save the updated MLMatlabScriptWrapper.pro file and execute the MLMatlabScriptWrapper.bat file. This + will create a C++ project for your system. Open the project file in Visual Studio and compile. + +4. Start MeVisLab and make sure that the Community Sources package is in the search path of MeVisLab. This + is set under Edit->Preferences->Packages in MeVisLab. Make sure that the Community/General package is + scanned by inspecting the Debug Output window. + +5. When the MatlabScriptWrapper module is dragged onto the MeVisLab workspace, a Matlab session should start + and a Matlab console window appear. If the module is red, make sure that you started the Release mode of + MeVisLab if you compiled in release mode, or in Debug mode if you compiled in debug mode. If the module + is still red, the DependencyWalker program can be used to find out which DLL-files that are missing. + +If you experience troubles, please search the MeVisLab forum http://www.mevis-research.de/cgi-bin/discus/discus.cgi + + + +General hints: + +- Under Windows, you may have to execute the command "matlab \regserver" from a Windows command prompt (not the Matlab prompt!). \ No newline at end of file Property changes on: trunk/Community/General/Sources/ML/MLMatlabScriptWrapper/README.txt ___________________________________________________________________ Added: svn:eol-style + native Modified: trunk/Community/General/Sources/ML/MLMatlabScriptWrapper/mlMatlabScriptWrapper.h =================================================================== --- trunk/Community/General/Sources/ML/MLMatlabScriptWrapper/mlMatlabScriptWrapper.h 2009-11-11 09:03:42 UTC (rev 216) +++ trunk/Community/General/Sources/ML/MLMatlabScriptWrapper/mlMatlabScriptWrapper.h 2009-11-17 18:00:35 UTC (rev 217) @@ -40,9 +40,12 @@ // Local includes #include "MLMatlabScriptWrapperSystem.h" -#include "MatlabCommon/engine.h" #include "mlXMarkerList.h" +// Include the Matlab engine. Note that the correct path to this +// file must be set in the MLMatlabScriptWrapper.pro file. +#include "engine.h" + ML_START_NAMESPACE //! The ML module class MatlabScriptWrapper. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bro...@us...> - 2009-11-11 09:03:48
|
Revision: 216 http://mevislabmodules.svn.sourceforge.net/mevislabmodules/?rev=216&view=rev Author: broersen Date: 2009-11-11 09:03:42 +0000 (Wed, 11 Nov 2009) Log Message: ----------- ENH: -Updated documentation and changed window size Modified Paths: -------------- trunk/Community/General/Modules/ML/MLMatlabScriptWrapper/MLMatlabScriptWrapper.def trunk/Community/General/Modules/ML/MLMatlabScriptWrapper/html/MatlabScriptWrapper.html Modified: trunk/Community/General/Modules/ML/MLMatlabScriptWrapper/MLMatlabScriptWrapper.def =================================================================== --- trunk/Community/General/Modules/ML/MLMatlabScriptWrapper/MLMatlabScriptWrapper.def 2009-11-11 08:55:19 UTC (rev 215) +++ trunk/Community/General/Modules/ML/MLMatlabScriptWrapper/MLMatlabScriptWrapper.def 2009-11-11 09:03:42 UTC (rev 216) @@ -22,9 +22,9 @@ seeAlso = "" documentation = "$(LOCAL)/html/MatlabScriptWrapper.html" exampleNetwork = "$(LOCAL)/networks/MatlabScriptWrapperExample.mlab" - + Window { - width = 500 + width = 600 Category Main { Vertical { margin = 4 @@ -33,7 +33,7 @@ autoApply = Yes showLineNumbers = Yes } - + CheckBox useExternalScript {} Horizontal { Field matlabScriptPath { @@ -75,8 +75,8 @@ Field status { title = "Status:" edit = No } Button update { alignX = Left title = "Update" } } - } - Category Scalars{ + } // Category Main + Category Scalars { Horizontal { Vertical { Horizontal { @@ -105,41 +105,11 @@ } } } - } - Category Strings { + } // Category Scalars + Category Vectors { Horizontal { Vertical { Horizontal { - Field stringName0 {title = "Name:" expandX = yes} - Field string0 {title = "Value:" expandX = yes} - } - Horizontal { - Field stringName1 {title = "Name:" expandX = yes} - Field string1 {title = "Value:" expandX = yes} - } - Horizontal { - Field stringName2 {title = "Name:" expandX = yes} - Field string2 {title = "Value:" expandX = yes} - } - Horizontal { - Field stringName3 {title = "Name:" expandX = yes} - Field string3 {title = "Value:" expandX = yes} - } - Horizontal { - Field stringName4 {title = "Name:" expandX = yes} - Field string4 {title = "Value:" expandX = yes} - } - Horizontal { - Field stringName5 {title = "Name:" expandX = yes} - Field string5 {title = "Value:" expandX = yes} - } - } - } - } - Category Vectors{ - Horizontal { - Vertical { - Horizontal { Field vectorName0 {title = "Name:" expandX = yes} Field vector0 {title = "Value:" expandX = yes} } @@ -165,25 +135,58 @@ } } } - } + } // Category Vectors Category Matrices { Horizontal { Vertical { Vertical { + //Field matrixName0 { title = "Name:" alignY = Top visibleOn = numberOfMatrices } + //TextView matrix0 { title = "Value:" maxh = 93 autoApply = Yes visibleOn = numberOfMatrices } + Field matrixName0 {title = "Name:" expandX = yes} - TextView matrix0 {title = "Value:" expandX = yes autoApply = Yes} + TextView matrix0 {title = "Value:" maxh = 93 expandX = yes autoApply = Yes} } Vertical { Field matrixName1 {title = "Name:" expandX = yes} - TextView matrix1 {title = "Value:" expandX = yes autoApply = Yes} + TextView matrix1 {title = "Value:" maxh = 93 expandX = yes autoApply = Yes} } Vertical { Field matrixName2 {title = "Name:" expandX = yes} - TextView matrix2 {title = "Value:" expandX = yes autoApply = Yes} + TextView matrix2 {title = "Value:" maxh = 93 expandX = yes autoApply = Yes} } } } - } + } // Category Matrices + Category Strings { + Horizontal { + Vertical { + Horizontal { + Field stringName0 {title = "Name:" expandX = yes} + Field string0 {title = "Value:" expandX = yes} + } + Horizontal { + Field stringName1 {title = "Name:" expandX = yes} + Field string1 {title = "Value:" expandX = yes} + } + Horizontal { + Field stringName2 {title = "Name:" expandX = yes} + Field string2 {title = "Value:" expandX = yes} + } + Horizontal { + Field stringName3 {title = "Name:" expandX = yes} + Field string3 {title = "Value:" expandX = yes} + } + Horizontal { + Field stringName4 {title = "Name:" expandX = yes} + Field string4 {title = "Value:" expandX = yes} + } + Horizontal { + Field stringName5 {title = "Name:" expandX = yes} + Field string5 {title = "Value:" expandX = yes} + } + } + } + } // Category Strings } // Window } // MLModule MatlabScriptWrapper Modified: trunk/Community/General/Modules/ML/MLMatlabScriptWrapper/html/MatlabScriptWrapper.html =================================================================== --- trunk/Community/General/Modules/ML/MLMatlabScriptWrapper/html/MatlabScriptWrapper.html 2009-11-11 08:55:19 UTC (rev 215) +++ trunk/Community/General/Modules/ML/MLMatlabScriptWrapper/html/MatlabScriptWrapper.html 2009-11-11 09:03:42 UTC (rev 216) @@ -3,180 +3,112 @@ <head> </head> - <body> - - - - <center> -<a href="#Purpose">Purpose</a> -<a href="#Usage">Usage</a> -<a href="#Details">Details</a> -<a href="#Inputs">Inputs</a> -<a href="#Outputs">Outputs</a> -<a href="#Parameters">Parameters</a> -<a href="#Events%20And%20Interaction">Events And Interaction</a> -<a href="#Example">Example</a> -<a href="#Tips%20And%20Tricks">Tips And Tricks</a> -<a href="#Known%20Bugs">Known Bugs</a> - +<a href="#Purpose">Purpose</a> +<a href="#Usage">Usage</a> +<a href="#Details">Details</a> +<a href="#Inputs">Inputs</a> +<a href="#Outputs">Outputs</a> +<a href="#Parameters">Parameters</a> +<a href="#Events%20And%20Interaction">Events And Interaction</a> +<a href="#Example">Example</a> +<a href="#Tips%20And%20Tricks">Tips And Tricks</a> +<a href="#Known%20Bugs">Known Bugs</a> <hr width="100%"> </center> +<h2>MatlabScriptWrapper</h2> - - -<h2>MatlabScriptWrapper -</h2> - - - - - <h3><a name="Purpose"></a>Purpose</h3> - - - - <blockquote style="margin-top: 5pt; margin-bottom: 5pt;"> -The <b>MatlabScriptWrapper</b> module offers -the possibility to execute Matlab scripts within -MevisLab and establish a link to a Matlab console, for example to -transfer data between MeVisLab and Matlab. Note that Matlab must be -installed for this module to function.</blockquote> +The <b>MatlabScriptWrapper</b> module offers the possibility to execute Matlab scripts within +MevisLab and establish a link to a Matlab console, for example to transfer data between MeVisLab +and Matlab. Note that Matlab must be installed for this module to function. +</blockquote> - - - <h3><a name="Usage"></a>Usage</h3> +<blockquote style="margin-top: 5pt; margin-bottom: 5pt;"> +Currently, three types of data structures can be transferred between MeVisLab and Matlab:<br> +<ul> + <li><span style="font-weight: bold;">Images:</span> + Up to three images can be used. Images are stored as up to six dimensional matrices in Matlab. + Note that MeVisLab and Matlab use different coordinate systems, see below for further information. + </li> + <br> + <li><span style="font-weight: bold;">XMarkerLists:</span> + An XMarker is an object that contains a point (up to 6-D), a vector (3-D) and a type variable (integer). + An XMarkerList is an array of XMarker objects. + In Matlab, an XMarkerList is represented as a struct with the following members: + </li> + <br> + <span style="font-style: italic;"><variablename></span>.pos, where pos is an + <span style="font-style: italic;">N</span>x2, + <span style="font-style: italic;">N</span>x3, + <span style="font-style: italic;">N</span>x4, + <span style="font-style: italic;">N</span>x5 or + <span style="font-style: italic;">N</span>x6 matrix with the position coordinates. + <span style="font-style: italic;">N</span> is the number of XMarkers. + <br> + <span style="font-style: italic;"><variablename></span>.vec, where vec is an + <span style="font-style: italic;">N</span>x2 or + <span style="font-style: italic;">N</span>x3 matrix of vectors. + <br> + <span style="font-style: italic;"><variablename></span>.type, where type is an + <span style="font-style: italic;">N</span>x1 vector of integers.<br> + <br> + Important: the pos matrix determines the number of XMarkers + <span style="font-style: italic;">N</span>. The vec and type matrices must have the same number of rows + <span style="font-style: italic;">N</span>, otherwise will these values not be copied back to MeVisLab. + See the example network for an example.<br> + <br> + <li><span style="font-weight: bold;">Scalars: </span> + Double precision. These can be used both as input and ouput variables. + Field notifications will be sent in MeVisLab only if a scalar has changed its + value after the Matlab script execution. + </li> + <li><span style="font-weight: bold;">Vectors: </span> + Double precision 4-D integer point. These can be used both as input and ouput + variables. Field notifications will be sent in MeVisLab only if a + vector has changed its value after the Matlab script execution. + </li> + <li><span style="font-weight: bold;">Matrices: </span> + Double precision 4x4 integer matrix. These can be used both as input and ouput + variables. Field notifications will be sent in MeVisLab only if a + matrix has changed its value after the Matlab script execution. + </li> + <li><span style="font-weight: bold;">Strings: </span> + These can be used both as input and ouput variables. Field notifications will be + sent in MeVisLab only if a string has changed its value after the Matlab script execution. + </li> +</ul> - - -<blockquote style="margin-top: 5pt; margin-bottom: 5pt;">Currently, three types of data structures can be transferred between MeVisLab and Matlab: <br> - - - - - - - <ul> - - - - <li><span style="font-weight: bold;">Images:</span> Up to 3 images can be used. Images are -stored as up to 6 dimensional matrices in Matlab. Note that MeVisLab -and Matlab use different coordinate systems, see below for further -information.</li> - - - - - - - </ul> - - - - - - - <ul> - - - - <li><span style="font-weight: bold;">XMarkerLists:</span> An -XMarker is an object that contains a point (up to 6 dimensions), a -vector (3 dimension) and a type variable (integer). An XMarkerList is an array of XMarker objects. In Matlab, an XMarkerList is -represented as a struct with the following members</li> - - - - - - - </ul> - - - - <span style="font-style: italic;"><variablename></span>.pos where pos is an <span style="font-style: italic;">N</span>x2, <span style="font-style: italic;">N</span>x3, <span style="font-style: italic;">N</span>x4, <span style="font-style: italic;">N</span>x5 or <span style="font-style: italic;">N</span>x6 matrix with the position coordinates. <span style="font-style: italic;">N</span> is the number of XMarkers.<br> - - - - <span style="font-style: italic;"><variablename></span>.vec where vec is an <span style="font-style: italic;">N</span>x2 or <span style="font-style: italic;">N</span>x3 matrix of vectors.<br> - - - - <span style="font-style: italic;"><variablename></span>.type where type is an <span style="font-style: italic;">N</span>x1 vector of integers.<br> - - - - <br> - - - - Important: the pos matrix determines the number of XMarkers <span style="font-style: italic;">N</span>. The vec and type matrices must have the same number of rows <span style="font-style: italic;">N</span>, -otherwise will - these values not be copied back to MeVisLab. See the example -network for an example.<br> - - - - - - - <ul> - - - - <li><span style="font-weight: bold;">Scalars: </span>Double -precision. These can be used both as input and ouput variables. Field -notifications will be sent in MeVisLab only if a scalar has changed its -value after the Matlab script execution.</li> - - - - - - - </ul> - - - -The variable names for the above data structures in the Matlab workspace can be set.<br> - - -The Matlab script can be written directly in the module GUI, or an -external script file (.m) can be called. If you choose to use -existing script the script in script field will -disappear and there is no posibility to edit matlab script file form -MevisLab. <br> - - -Push the "Update"-button to execute the Matlab script, or set Auto-Update. +The variable names for the above data structures in the Matlab workspace can be set. +<br> +The Matlab script can be written directly in the module GUI, or an external script file (.m) can be called. +If you choose to use existing script, the script in script field will disappear and +there is no posibility to edit a Matlab script file from MevisLab. +<br> +Push the "Update"-button to execute the Matlab script, or set Auto-Update on input data change. +<br> +Use the "Show Matlab session window" checkbox to show or hide the session window. +<br> +The "Restart Matlab"-button can be used to restart a Matlab session once it is terminated externally. +<br> </blockquote> - - - - - <h3><a name="Details"></a>Details</h3> - - - - -<blockquote style="margin-top: 5pt; margin-bottom: 5pt;"><span style="font-weight: bold;">Coordinate systems in MeVisLab and Matlab</span><br> - - +<blockquote style="margin-top: 5pt; margin-bottom: 5pt;"> +<span style="font-weight: bold;">Coordinate systems in MeVisLab and Matlab</span> +<br> In the context of this module, the only coordinate system that is considered is the discrete voxel index coordinate system, i.e., images are considered as multidimensional matrices. Both MeVisLab and Matlab @@ -184,270 +116,122 @@ "downwards". However, note that MeVisLab starts counting a 0, whereas Matlab starts counting a 1, i.e., the upper left voxel has the coordinate (0,0) in MeVisLab and (1,1) in Matlab. The major difference -between MeVisLab and Matlab is the indexing order: MeVisLab uses +between MeVisLab and Matlab is the indexing order: MeVisLab uses [x,y] while Matlab uses [y,x] (i.e., row-column into a matrix). Thus, an image will appear flipped when exported from MeVisLab and visualized -in Matlab or vice-versa. To correct for this, one can use the <span style="font-style: italic;">permute</span> command in Matlab, for example<br> - - - <br> - - +in Matlab or vice-versa. To correct for this, one can use the +<span style="font-style: italic;">permute</span> command in Matlab, for example:<br> +<br> >> permute(Input0,[2 1])<br> - - - <br> - - +<br> which swaps the x and y axes. See the example network for an example.<br> - - </blockquote> - - - - <h3><a name="Inputs"></a>Inputs</h3> - - - - -<blockquote style="margin-top: 5pt; margin-bottom: 5pt;">Up to 3 input -images and one XMarkerlist can be attached to the module. Input to the -module from MeVisLab is optional, the output can be generated entirely +<blockquote style="margin-top: 5pt; margin-bottom: 5pt;"> +Up to three input images and one XMarkerList can be attached to the module. +Input to the module from MeVisLab is optional, the output can be generated entirely in Matlab without input from MeVisLab (see the example network for examples). </blockquote> - - - - <h3><a name="Outputs"></a>Outputs</h3> - - - - -<blockquote style="margin-top: 5pt; margin-bottom: 5pt;">Up to 3 output images and one XMarkerList. +<blockquote style="margin-top: 5pt; margin-bottom: 5pt;"> +Up to three output images and one XMarkerList. </blockquote> - - - - <h3><a name="Parameters"></a>Parameters</h3> - - - - - - -<blockquote style="margin-top: 5pt; margin-bottom: 5pt;"><b> Matlab Script</b><br> - - -A field where the Matlab script can be written. <b></b> +<blockquote style="margin-top: 5pt; margin-bottom: 5pt;"> +<b>Matlab Script</b> +<br> +A field where the Matlab script can be written.<br> </blockquote> - - - - - - -<blockquote style="margin-top: 5pt; margin-bottom: 5pt;"><b>Use External Script</b><br> - - +<blockquote style="margin-top: 5pt; margin-bottom: 5pt;"> +<b>Use External Script</b> +<br> Enables the possibility to use an external Matlab script file (.m).<br> - - - </blockquote> - - - - - - - - - - - - -<blockquote style="margin-top: 5pt; margin-bottom: 5pt;"><b>Input/Output image, XMarker names</b><br> - - -The variable names in the Matlab script of the input and output data structures. +<blockquote style="margin-top: 5pt; margin-bottom: 5pt;"> +<b>Auto-update on input data change</b> +<br> +Execute the script automatically on input change (only for input images +and the XMarkerList, not for changes in the GUI).<br> </blockquote> - - - - - - - - - - - - - - - - - -<blockquote style="margin-top: 5pt; margin-bottom: 5pt;"><span style="font-weight: bold;">Auto-update on input data change</span><br> - - -Execute the script automatically on input change (only for input images and the XMarkerList, not for changes in the GUI).<br> - - - <span style="font-weight: bold;">Show Matlab session window</span><br> - +<blockquote style="margin-top: 5pt; margin-bottom: 5pt;"> +<b>Show Matlab session window</b> +<br> Show or hide the Matlab session window.<br> +</blockquote> - <span style="font-weight: bold;">Restart Matlab</span><br> +<blockquote style="margin-top: 5pt; margin-bottom: 5pt;"> +<b>Restart Matlab</b> +<br> +Restarts the Matlab engine.<br> +</blockquote> -Restarts the Matlab engine.<br><br> - - - <span style="font-weight: bold;">Status</span><br> - - +<blockquote style="margin-top: 5pt; margin-bottom: 5pt;"> +<b>Status</b> +<br> This field gives information whether the Matlab script was executed correctly or not.<br> +</blockquote> - <br> - - - - +<blockquote style="margin-top: 5pt; margin-bottom: 5pt;"> +<b>Update</b> +<br> +Execute the Matlab script.<br> </blockquote> - - - - - - -<blockquote style="margin-top: 5pt; margin-bottom: 5pt;"><b>Update</b><br> - - -Execute the Matlab script.<b><br> - - - </b></blockquote> - - - - -<blockquote style="margin-top: 5pt; margin-bottom: 5pt;"><b><br> - - - </b> +<br> +<blockquote style="margin-top: 5pt; margin-bottom: 5pt;"> +<b>Input/Output image, XMarkerList, scalar, vector, matrix names and strings</b> +<br> +The variable names in the Matlab script of the input and output data structures.<br> </blockquote> - - - - <h3><a name="Events And Interaction"></a>Events And Interaction</h3> - - - - <blockquote style="margin-top: 5pt; margin-bottom: 5pt;"> - <span style="color: rgb(0, 0, 0);">-</span></blockquote> +<span style="color: rgb(0, 0, 0);">-</span> +</blockquote> - - - <h3><a name="Example"></a>Example</h3> +<blockquote style="margin-top: 5pt; margin-bottom: 5pt;"> +The example network shows a number of different uses of the <b>MatlabScriptWrapper</b> module.<br> +</blockquote> - The example network shows a number of different uses of the <span style="font-weight: bold;">MatlabScriptWrapper</span> module.<br> - - <h3><a name="Tips And Tricks"></a>Tips And Tricks</h3> - - - - <blockquote style="margin-top: 5pt; margin-bottom: 5pt;"> - <span style="color: rgb(255, 0, 0);"><span style="color: rgb(0, 0, 0);">-</span> </span> +<span style="color: rgb(0, 0, 0);">-</span> </blockquote> - - - <h3><a name="Known Bugs"></a>Known Bugs</h3> - - - - <blockquote style="margin-top: 5pt; margin-bottom: 5pt;"> - <span style="color: rgb(0, 0, 0);">-</span></blockquote> +<span style="color: rgb(0, 0, 0);">-</span> +</blockquote> +<br><br><br><br><br><br> - - - -<br> - - - - - -<br> - - - - - -<br> - - - - - -<br> - - - - - -<br> - - - - - -<br> - - - - - </body> </html> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bro...@us...> - 2009-11-11 08:55:32
|
Revision: 215 http://mevislabmodules.svn.sourceforge.net/mevislabmodules/?rev=215&view=rev Author: broersen Date: 2009-11-11 08:55:19 +0000 (Wed, 11 Nov 2009) Log Message: ----------- ENH: -Added some checks on data types and dimensions 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 2009-11-03 09:17:13 UTC (rev 214) +++ trunk/Community/General/Sources/ML/MLMatlabScriptWrapper/mlMatlabScriptWrapper.cpp 2009-11-11 08:55:19 UTC (rev 215) @@ -418,7 +418,7 @@ //break; default: getOutImg(outIndex)->setDataType(ML_BAD_DATA_TYPE); - std::cerr << "calcOutImageProps(): Output type from Matlab not supported!" << std::endl << std::flush; + std::cerr << "calcOutImageProps(): Output type from Matlab not supported" << std::endl << std::flush; } mxDestroyArray(m_pImage); m_pImage = NULL; @@ -472,9 +472,7 @@ //---------------------------------------------------------------------------------- //! Type specific page calculation. //---------------------------------------------------------------------------------- -void MatlabScriptWrapper::calcOutSubImage (SubImg *outSubImg, - int outIndex, - SubImg* /*inSubImgs*/) +void MatlabScriptWrapper::calcOutSubImage (SubImg *outSubImg, int outIndex, SubImg* /*inSubImgs*/) { ML_TRACE_IN("MatlabScriptWrapper::calcOutSubImage ()"); @@ -505,7 +503,7 @@ //break; default: outputClass = ML_BAD_DATA_TYPE; - std::cerr << "calcOutSubImage(): Output type from Matlab not supported!" << std::endl << std::flush; + std::cerr << "calcOutSubImage(): Output type from Matlab not supported" << std::endl << std::flush; } SubImg subImgBuf(outSubImg->getBox(), outputClass, mxGetPr(m_pImage)); outSubImg->copySubImage(subImgBuf); @@ -606,7 +604,6 @@ clearString << _matrixNameFld[i]->getStringValue() << " "; } - // Clear input images for(int i=0; i<3; i++) { clearString << _inDataNameFld[i]->getStringValue() << " "; @@ -694,7 +691,7 @@ default: inputClass = mxDOUBLE_CLASS; elementSize = sizeof(double); - std::cerr << "_copyInputImageDataToMatlab(): Output type from MeVisLab not supported!" << std::endl << std::flush; + std::cerr << "_copyInputImageDataToMatlab(): Output type from MeVisLab not supported" << std::endl << std::flush; } // Create numeric array mxArray *m_pImage = mxCreateNumericArray(6, insizesArray, inputClass, mxREAL); @@ -801,9 +798,10 @@ mxArray *m_type = engGetVariable(m_pEngine, "tmpOutXMarkerListType"); engEvalString(m_pEngine, "clear tmpOutXMarkerListType"); - // Get data from matlab array. - if(m_pos && !mxIsEmpty(m_pos)) - { + // Get data from Matlab array. + if((m_pos && !mxIsEmpty(m_pos) && mxGetClassID(m_pos) ==mxDOUBLE_CLASS) && + (m_vec && !mxIsEmpty(m_vec) && mxGetClassID(m_vec) ==mxDOUBLE_CLASS) && + (m_type && !mxIsEmpty(m_type)&& mxGetClassID(m_type)==mxDOUBLE_CLASS)) { double *dataPos = static_cast<double*>(mxGetPr(m_pos)); double *dataVec = static_cast<double*>(mxGetPr(m_vec)); double *dataType = static_cast<double*>(mxGetPr(m_type)); @@ -897,10 +895,13 @@ for(MLint i=0; i<6; i++) { temp = engGetVariable(m_pEngine, (_scalarNameFld[i]->getStringValue()).c_str()); - if(temp!=NULL) - { - double *fieldVal = static_cast<double*>(mxGetPr(temp)); - _scalarFld[i]->setDoubleValue(fieldVal[0]); + if(temp!=NULL) { + if(mxGetClassID(temp)==mxDOUBLE_CLASS) { + double *fieldVal = static_cast<double*>(mxGetPr(temp)); + _scalarFld[i]->setDoubleValue(fieldVal[0]); + } else { + std::cerr << "_getVectorsBackFromMatlab(): Output type from Matlab not supported" << std::endl << std::flush; + } } } mxDestroyArray(temp); @@ -992,7 +993,7 @@ // Check if Matlab is started. if (!_checkMatlabIsStarted()) { - std::cerr << "_getVectorssBackFromMatlab(): Cannot find Matlab engine!" << std::endl << std::flush; + std::cerr << "_getVectorsBackFromMatlab(): Cannot find Matlab engine!" << std::endl << std::flush; return; } @@ -1002,10 +1003,17 @@ for(MLint i=0; i<6; i++) { temp = engGetVariable(m_pEngine, (_vectorNameFld[i]->getStringValue()).c_str()); - if(temp!=NULL) - { - double *fieldVal = static_cast<double*>(mxGetPr(temp)); - _vectorFld[i]->setVec4fValue(vec4(fieldVal[0],fieldVal[1],fieldVal[2],fieldVal[3])); + if(temp!=NULL) { + if(mxGetClassID(temp)==mxDOUBLE_CLASS) { + double *fieldVal = static_cast<double*>(mxGetPr(temp)); + if(mxGetM(temp)==1 && mxGetN(temp)==4) { + _vectorFld[i]->setVec4fValue(vec4(fieldVal[0],fieldVal[1],fieldVal[2],fieldVal[3])); + } else { + std::cerr << "_getVectorsBackFromMatlab(): Incorrect vector size" << std::endl << std::flush; + } + } else { + std::cerr << "_getVectorsBackFromMatlab(): Output type from Matlab not supported" << std::endl << std::flush; + } } } mxDestroyArray(temp); @@ -1057,13 +1065,20 @@ for(MLint i=0; i<3; i++) { temp = engGetVariable(m_pEngine, (_matrixNameFld[i]->getStringValue()).c_str()); - if(temp!=NULL) - { - double *fieldVal = static_cast<double*>(mxGetPr(temp)); - _matrixFld[i]->setMatrixValue(mat4(fieldVal[0],fieldVal[4],fieldVal[8],fieldVal[12], - fieldVal[1],fieldVal[5],fieldVal[9],fieldVal[13], - fieldVal[2],fieldVal[6],fieldVal[10],fieldVal[14], - fieldVal[3],fieldVal[7],fieldVal[11],fieldVal[15])); + if(temp!=NULL) { + if(mxGetClassID(temp)==mxDOUBLE_CLASS) { + double *fieldVal = static_cast<double*>(mxGetPr(temp)); + if(mxGetM(temp)==4 && mxGetN(temp)==4) { + _matrixFld[i]->setMatrixValue(mat4(fieldVal[0],fieldVal[4], fieldVal[8],fieldVal[12], + fieldVal[1],fieldVal[5], fieldVal[9],fieldVal[13], + fieldVal[2],fieldVal[6],fieldVal[10],fieldVal[14], + fieldVal[3],fieldVal[7],fieldVal[11],fieldVal[15])); + } else { + std::cerr << "_getMatricesBackFromMatlab(): Incorrect matrix size" << std::endl << std::flush; + } + } else { + std::cerr << "_getMatricesBackFromMatlab(): Output type from Matlab not supported" << std::endl << std::flush; + } } } mxDestroyArray(temp); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rha...@us...> - 2009-11-03 09:17:22
|
Revision: 214 http://mevislabmodules.svn.sourceforge.net/mevislabmodules/?rev=214&view=rev Author: rhameeteman Date: 2009-11-03 09:17:13 +0000 (Tue, 03 Nov 2009) Log Message: ----------- KH. * Added .vtp as a loadable extension for the vtkXMLPolyDataReader Modified Paths: -------------- trunk/Community/General/Modules/Macros/LoadAny/LoadAny.js Modified: trunk/Community/General/Modules/Macros/LoadAny/LoadAny.js =================================================================== --- trunk/Community/General/Modules/Macros/LoadAny/LoadAny.js 2009-10-19 11:57:24 UTC (rev 213) +++ trunk/Community/General/Modules/Macros/LoadAny/LoadAny.js 2009-11-03 09:17:13 UTC (rev 214) @@ -265,6 +265,7 @@ [".xml" , "vtkXMLMultiGroupDataReader" , "outputXMLMultiGroupDataReader" , "fileName" , "VTK XML reader for vtk multigroup data" , "Yes", "", "" , "" , "" ], [".xml" , "vtkXMLPImageDataReader" , "outputXMLPImageDataReader" , "fileName" , "" , "Yes", "vtkXMLPImageDataWriter", "" , "" , "" ], [".xml" , "vtkXMLPolyDataReader" , "outputXMLPolyDataReader" , "fileName" , "" , "Yes", "vtkXMLPolyDataWriter", "" , "" , "" ], + [".vtp" , "vtkXMLPolyDataReader" , "outputXMLPolyDataReader" , "fileName" , "" , "Yes", "vtkXMLPolyDataWriter", "" , "" , "" ], [".xml" , "vtkXMLPPolyDataReader" , "outputXMLPPolyDataReader" , "fileName" , "" , "Yes", "vtkXMLPPolyDataWriter", "" , "" , "" ], [".xml" , "vtkXMLPRectilinearGridReader" , "outputXMLPRectilinearGridReader" , "fileName" , "" , "Yes", "vtkXMLPRectilinearGridWriter", "" , "" , "" ], [".xml" , "vtkXMLPStructuredGridReader" , "outputXMLPStructuredGridReader" , "fileName" , "" , "Yes", "vtkXMLPStructuredGridWriter", "" , "" , "" ], This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bro...@us...> - 2009-10-19 11:57:32
|
Revision: 213 http://mevislabmodules.svn.sourceforge.net/mevislabmodules/?rev=213&view=rev Author: broersen Date: 2009-10-19 11:57:24 +0000 (Mon, 19 Oct 2009) Log Message: ----------- ENH: -Reworked copyInputXMarkerToMatlab and some other code Modified Paths: -------------- trunk/Community/General/Sources/ML/MLMatlabScriptWrapper/mlMatlabScriptWrapper.cpp trunk/Community/General/Sources/ML/MLMatlabScriptWrapper/mlMatlabScriptWrapper.h Modified: trunk/Community/General/Sources/ML/MLMatlabScriptWrapper/mlMatlabScriptWrapper.cpp =================================================================== --- trunk/Community/General/Sources/ML/MLMatlabScriptWrapper/mlMatlabScriptWrapper.cpp 2009-10-15 11:53:22 UTC (rev 212) +++ trunk/Community/General/Sources/ML/MLMatlabScriptWrapper/mlMatlabScriptWrapper.cpp 2009-10-19 11:57:24 UTC (rev 213) @@ -126,7 +126,7 @@ (_stringFld[4] = fields->addString("string4"))->setStringValue(""); (_stringNameFld[5] = fields->addString("stringName5"))->setStringValue("string5"); (_stringFld[5] = fields->addString("string5"))->setStringValue(""); - + // Set vector name and value fields. (_vectorNameFld[0] = fields->addString("vectorName0"))->setStringValue("vector0"); (_vectorFld[0] = fields->addVec4f("vector0"))->setStringValue("0 0 0 0"); @@ -149,9 +149,6 @@ (_matrixNameFld[2] = fields->addString("matrixName2"))->setStringValue("matrix2"); (_matrixFld[2] = fields->addMatrix("matrix2"))->setStringValue("1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1"); - //! Reactivate calls of handleNotification on field changes. - handleNotificationOn(); - m_pEngine = engOpen(NULL); if ( !_checkMatlabIsStarted() ) @@ -178,6 +175,9 @@ engGetVisible(m_pEngine, &vis); (_showSessionWindowFld = fields->addBool("showSessionWindow"))->setBoolValue(vis); } + + //! Reactivate calls of handleNotification on field changes. + handleNotificationOn(); } @@ -225,9 +225,9 @@ } } - // Update output only if autoapply is enabled. - if ( ((field == getInField(0))||(field == getInField(1))||(field == getInField(2))) && (_autoCalculationFld->isOn()) - || (field == _calculateFld) ) { + // Update output on an update or if autoapply is enabled. + if( (field == _calculateFld) || + _autoCalculationFld->isOn() && ((field == getInField(0))||(field == getInField(1))||(field == getInField(2))) ) { // Check if Matlab is started. if (!_checkMatlabIsStarted()) { _statusFld->setStringValue("Cannot find Matlab engine!"); @@ -245,8 +245,14 @@ // Execute Matlab script only when the string is valid if(validScriptString) { - // Copy input XMarker to matlab. - _copyInputXMarkerToMatlab(); + if( _inputXMarkerListFld->getBaseValue() != NULL ) { + // Check if a valid XMarkerList is attached to the input. + if( _inputXMarkerListFld->isValidValue() && ML_BASE_IS_A(_inputXMarkerListFld->getBaseValue(), XMarkerList) ) { + // Copy input XMarkerList to Matlab. + _copyInputXMarkerToMatlab(); + } + } + // Copy input image data to matlab. _copyInputImageDataToMatlab(); // Copy scalar values to matlab. @@ -258,7 +264,6 @@ // Copy matrix values to matlab. _copyInputMatricesToMatlab(); - // Insert at the end of the script variable to proof execution status // and run the script in Matlab evaluateString += "\nmevmatscr=1"; @@ -376,7 +381,7 @@ return; } - // Get variable name in the matlab workspace of the output image + // Get variable name in the Matlab workspace of the output image std::string outname = _outDataNameFld[outIndex]->getStringValue(); mxArray *m_pImage = engGetVariable(m_pEngine, outname.c_str()); @@ -417,7 +422,7 @@ } mxDestroyArray(m_pImage); m_pImage = NULL; - // Get min and max values in matlab workspace and set them in MeVisLab + // Get min and max values in Matlab workspace and set them in MeVisLab std::ostringstream minmaxCommand; minmaxCommand << "mevtmpminval = min(" << outname << "(:));" << "mevtmpmaxval = max(" << outname << "(:));"; engEvalString(m_pEngine, minmaxCommand.str().c_str()); @@ -434,9 +439,7 @@ mxDestroyArray(minVal); minVal = NULL; mxDestroyArray(maxVal); maxVal = NULL; engEvalString(m_pEngine, "clear mevtmpminval mevtmpmaxval"); - } - else - { + } else { getOutImg(outIndex)->setOutOfDate(); getOutImg(outIndex)->setStateInfo("Cannot set output size, because variable could not be found in Matlab workspace.",ML_BAD_DATA_TYPE); } @@ -478,7 +481,7 @@ // Check if Matlab is started. if (!_checkMatlabIsStarted()) { - std::cerr << "calcOutImageProps(): Cannot finding matlab engine!" << std::endl << std::flush; + std::cerr << "calcOutImageProps(): Cannot find Matlab engine!" << std::endl << std::flush; return; } @@ -512,7 +515,7 @@ else { // Throw error, if no data available. - ML_PRINT_ERROR("MatlabScriptWrapper::calcOutSubImage()", ML_BAD_INPUT_IMAGE_POINTER, "Cannot copy from matlab data."); + ML_PRINT_ERROR("MatlabScriptWrapper::calcOutSubImage()", ML_BAD_INPUT_IMAGE_POINTER, "Cannot copy from Matlab data."); } } @@ -520,12 +523,116 @@ // Internal (private) methods. ////////////////////////////////////////////////////////////////////// +//! Loads matlab script from a file, pastes it into script field and saves user written script. +bool MatlabScriptWrapper::_loadMatlabScriptFromFile(std::string& evaluateString) +{ + // Clear input string + evaluateString.clear(); + + // Temporary string for reading input. + std::ostringstream tmpString; + + // Update script window if new script chosen. + std::string pathString = _matlabScriptPathFld->getStringValue(); + + ML_TRY + { + if(pathString.empty()) { + _statusFld->setStringValue("Script path is empty."); + return false; + } + else + { + // File to open. + std::ifstream dat; + dat.open(pathString.c_str()); + if(dat.fail()) { + // Throw error message if file couldn't be opened. + _statusFld->setStringValue("Cannot find .m-file!"); + return false; + } + + // Read script line by line from file. + std::string line; + while(!dat.eof()) + { + getline(dat, line); + tmpString << line << "\n"; + } + + // Close file + dat.close(); + + // Get string + evaluateString = tmpString.str(); + } + } + ML_CATCH_RETHROW; + + return true; +} + +//! Check if Matlab is started. +bool MatlabScriptWrapper::_checkMatlabIsStarted() +{ + if(0 == engEvalString(m_pEngine, "mevTestIfMatlabIsRunning=3.14")) + { + engEvalString(m_pEngine, "clear mevTestIfMatlabIsRunning"); + return true; + } + else + { + return false; + } +} + +void MatlabScriptWrapper::_clearAllVariables() +{ + std::ostringstream clearString; + clearString << "clear "; + + // Clear scalars + for(int i=0; i<6; i++) { + clearString << _scalarNameFld[i]->getStringValue() << " "; + } + + // Clear strings + for(int i=0; i<6; i++) { + clearString << _stringNameFld[i]->getStringValue() << " "; + } + + // Clear matrices + for(int i=0; i<3; i++) { + clearString << _matrixNameFld[i]->getStringValue() << " "; + } + + + // Clear input images + for(int i=0; i<3; i++) { + clearString << _inDataNameFld[i]->getStringValue() << " "; + } + + // Clear output images + for(int i=0; i<3; i++) { + clearString << _outDataNameFld[i]->getStringValue() << " "; + } + + // Clear input XMarker data + clearString << _inXMarkerNameFld->getStringValue() << " "; + + // Clear output XMarker data + clearString << _outXMarkerNameFld->getStringValue(); + + // Evaluate the string in Matlab + engEvalString(m_pEngine, clearString.str().c_str()); +} + //! Copy input image data to matlab. void MatlabScriptWrapper::_copyInputImageDataToMatlab() { if (!_checkMatlabIsStarted()) { - std::cerr << "_copyInputImageDataToMatlab(): Cannot finding matlab engine!" << std::endl << std::flush; + std::cerr << "_copyInputImageDataToMatlab(): Cannot find Matlab engine!" << std::endl << std::flush; return; } @@ -568,7 +675,7 @@ //MLuint32 inDataSize = inImg->getBoxFromImgExt().getExt().getStrides().u; const MLuint32 inDataSize = imgSize.x*imgSize.y*imgSize.z*imgSize.c*imgSize.t*imgSize.u; - // Set matlab image extent. + // Set Matlab image extent. const mwSize insizesArray[6] = {imgSize.x, imgSize.y, imgSize.z, imgSize.c, imgSize.t, imgSize.u}; // Copy different types of images from MeVisLab. @@ -592,12 +699,12 @@ // Create numeric array mxArray *m_pImage = mxCreateNumericArray(6, insizesArray, inputClass, mxREAL); - // Copy data to matlab array. + // Copy data to Matlab array. memcpy((void*)mxGetPr(m_pImage), data, inDataSize*elementSize); // Get input names from gui. std::string inputName = _inDataNameFld[i]->getStringValue(); - // Write data to matlab. + // Write data to Matlab. engPutVariable(m_pEngine, inputName.c_str(), m_pImage); mxDestroyArray(m_pImage); m_pImage = NULL; @@ -612,111 +719,47 @@ //! Copy input XMarkerList to matlab. void MatlabScriptWrapper::_copyInputXMarkerToMatlab() { - // Proof if Matlab is started. if (!_checkMatlabIsStarted()) { - std::cerr << "_copyInputXMarkerToMatlab(): Cannot finding matlab engine!" << std::endl << std::flush; + std::cerr << "_copyInputXMarkerToMatlab(): Cannot find Matlab engine!" << std::endl << std::flush; return; } + // Get input list. + XMarkerList inputXMarkerList = *((XMarkerList*)_inputXMarkerListFld->getBaseValue()); + // Internal loop. size_t i = 0; - // Get names from GUI. - std::ostringstream inXMarkerStr, outXMarkerStr; - inXMarkerStr << _inXMarkerNameFld->getStringValue(); - outXMarkerStr << _outXMarkerNameFld->getStringValue(); - // Combine string. - std::ostringstream setInXMarkerStr, setOutXMarkerStr; - setInXMarkerStr << inXMarkerStr.str() << "=struct('pos',[],'vec',[],'type',[])"; - setOutXMarkerStr << outXMarkerStr.str() << "=struct('pos',[],'vec',[],'type',[])"; + // Get input list name from GUI. + std::string inXMarkerStr = _inXMarkerNameFld->getStringValue(); - // Input XMarkerList transfered to matlab structure. - engEvalString(m_pEngine, setInXMarkerStr.str().c_str()); - engEvalString(m_pEngine, setOutXMarkerStr.str().c_str()); + // Strings to evaluate. + std::ostringstream setPos, setVec, setType; + setPos << inXMarkerStr.c_str() <<".pos=["; + setVec << inXMarkerStr.c_str() << ".vec=["; + setType << inXMarkerStr.c_str() << ".type=["; - // Check if a valid XMarkerList is attached to the input. - if( _inputXMarkerListFld->isValidValue() && ML_BASE_IS_A(_inputXMarkerListFld->getBaseValue(), XMarkerList)) + // Get XMarkerList size and go through all list step by step. + const size_t listSize = inputXMarkerList.size(); + for(i = 0; i < listSize; i++) { - // Get input list. - XMarkerList inputXMarkerList = *((XMarkerList*)_inputXMarkerListFld->getBaseValue()); + XMarker marker = inputXMarkerList[i]; - // Strings to evaluate. - std::ostringstream setPos, setVec, setType; - setPos << inXMarkerStr.str() <<".pos=["; - setVec << inXMarkerStr.str() << ".vec=["; - setType << inXMarkerStr.str() << ".type=["; - - // Get XMarkerList size and go through all list step by step. - const size_t listSize = inputXMarkerList.size(); - for(i = 0; i < listSize; i++) - { - XMarker marker = inputXMarkerList[i]; - - // Write pos, vec and type to strings. - setPos<<std::dec<<marker.x()<<","<<std::dec<<marker.y()<<","<<std::dec<<marker.z() - <<","<<std::dec<<marker.c()<<","<<std::dec<<marker.t()<<","<<std::dec<<marker.u()<<";"; - setVec<<std::dec<<marker.vx()<<","<<std::dec<<marker.vy()<<","<<std::dec<<marker.vz()<<";"; - setType<<std::dec<<marker.type<<";"; - } - - 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()); + // Write pos, vec and type to strings. + setPos<<std::dec<<marker.x()<<","<<std::dec<<marker.y()<<","<<std::dec<<marker.z() + <<","<<std::dec<<marker.c()<<","<<std::dec<<marker.t()<<","<<std::dec<<marker.u()<<";"; + setVec<<std::dec<<marker.vx()<<","<<std::dec<<marker.vy()<<","<<std::dec<<marker.vz()<<";"; + setType<<std::dec<<marker.type<<";"; } -} -//! Loads matlab script from a file, pastes it into script field and saves user written script. -bool MatlabScriptWrapper::_loadMatlabScriptFromFile(std::string& evaluateString) -{ - // Clear input string - evaluateString.clear(); - - // Temporary string for reading input. - std::ostringstream tmpString; - - // Update script window if new script chosen. - std::string pathString = _matlabScriptPathFld->getStringValue(); - - ML_TRY - { - if(pathString.empty()) { - _statusFld->setStringValue("Script path is empty."); - return false; - } - else - { - // File to open. - std::ifstream dat; - dat.open(pathString.c_str()); - if(dat.fail()) { - // Throw error message if file couldn't be opened. - _statusFld->setStringValue("Cannot find .m-file!"); - return false; - } - - // Read script line by line from file. - std::string line; - while(!dat.eof()) - { - getline(dat, line); - tmpString << line << "\n"; - } - - // Close file - dat.close(); - - // Get string - evaluateString = tmpString.str(); - } - } - ML_CATCH_RETHROW; - - return true; + 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()); } //! Gets XMarkerList from Matlab and copies results into output XMarkerList. @@ -728,12 +771,12 @@ // Check if Matlab is started. if (!_checkMatlabIsStarted()) { - std::cerr << "_getXMarkerBackFromMatlab(): Cannot finding matlab engine!" << std::endl << std::flush; + std::cerr << "_getXMarkerBackFromMatlab(): Cannot find Matlab engine!" << std::endl << std::flush; return; } // Internal loop. size_t i=0, j=0; - // Get names form gui. + // Get names from GUI. std::string outXMarkerStr = _outXMarkerNameFld->getStringValue(); // Compose temp string to execute in matlab. std::ostringstream executeStr; @@ -844,7 +887,7 @@ // Check if Matlab is started. if (!_checkMatlabIsStarted()) { - std::cerr << "_getScalarsBackFromMatlab(): Cannot finding matlab engine!" << std::endl << std::flush; + std::cerr << "_getScalarsBackFromMatlab(): Cannot find Matlab engine!" << std::endl << std::flush; return; } @@ -870,7 +913,7 @@ // Check if Matlab is started. if (!_checkMatlabIsStarted()) { - std::cerr << "_copyInputStringsToMatlab(): Cannot find matlab engine!" << std::endl << std::flush; + std::cerr << "_copyInputStringsToMatlab(): Cannot find Matlab engine!" << std::endl << std::flush; return; } // Internal loop. @@ -892,7 +935,7 @@ // Check if Matlab is started. if (!_checkMatlabIsStarted()) { - std::cerr << "_getStringsBackFromMatlab(): Cannot finding matlab engine!" << std::endl << std::flush; + std::cerr << "_getStringsBackFromMatlab(): Cannot find Matlab engine!" << std::endl << std::flush; return; } @@ -923,7 +966,7 @@ // Proof if Matlab is started. if (!_checkMatlabIsStarted()) { - std::cerr << "_copyInputVectorsToMatlab(): Cannot finding matlab engine!" << std::endl << std::flush; + std::cerr << "_copyInputVectorsToMatlab(): Cannot find Matlab engine!" << std::endl << std::flush; return; } // Internal loop. @@ -949,7 +992,7 @@ // Check if Matlab is started. if (!_checkMatlabIsStarted()) { - std::cerr << "_getVectorssBackFromMatlab(): Cannot finding matlab engine!" << std::endl << std::flush; + std::cerr << "_getVectorssBackFromMatlab(): Cannot find Matlab engine!" << std::endl << std::flush; return; } @@ -975,7 +1018,7 @@ // Proof if Matlab is started. if (!_checkMatlabIsStarted()) { - std::cerr << "_copyInputMatricesToMatlab(): Cannot finding matlab engine!" << std::endl << std::flush; + std::cerr << "_copyInputMatricesToMatlab(): Cannot find Matlab engine!" << std::endl << std::flush; return; } // Internal loop. @@ -1004,7 +1047,7 @@ // Check if Matlab is started. if (!_checkMatlabIsStarted()) { - std::cerr << "_getMatricesBackFromMatlab(): Cannot finding matlab engine!" << std::endl << std::flush; + std::cerr << "_getMatricesBackFromMatlab(): Cannot find Matlab engine!" << std::endl << std::flush; return; } @@ -1027,59 +1070,4 @@ temp = NULL; } -//! Check if Matlab is started. -bool MatlabScriptWrapper::_checkMatlabIsStarted() -{ - if(0 == engEvalString(m_pEngine, "mevTestIfMatlabIsRunning=3.14")) - { - engEvalString(m_pEngine, "clear mevTestIfMatlabIsRunning"); - return true; - } - else - { - return false; - } -} - -void MatlabScriptWrapper::_clearAllVariables() -{ - std::ostringstream clearString; - clearString << "clear "; - - // Clear scalars - for(int i=0; i<6; i++) { - clearString << _scalarNameFld[i]->getStringValue() << " "; - } - - // Clear strings - for(int i=0; i<6; i++) { - clearString << _stringNameFld[i]->getStringValue() << " "; - } - - // Clear matrices - for(int i=0; i<3; i++) { - clearString << _matrixNameFld[i]->getStringValue() << " "; - } - - - // Clear input images - for(int i=0; i<3; i++) { - clearString << _inDataNameFld[i]->getStringValue() << " "; - } - - // Clear output images - for(int i=0; i<3; i++) { - clearString << _outDataNameFld[i]->getStringValue() << " "; - } - - // Clear input XMarker data - clearString << _inXMarkerNameFld->getStringValue() << " "; - - // Clear output XMarker data - clearString << _outXMarkerNameFld->getStringValue(); - - // Evaluate the string in Matlab - engEvalString(m_pEngine, clearString.str().c_str()); -} - ML_END_NAMESPACE Modified: trunk/Community/General/Sources/ML/MLMatlabScriptWrapper/mlMatlabScriptWrapper.h =================================================================== --- trunk/Community/General/Sources/ML/MLMatlabScriptWrapper/mlMatlabScriptWrapper.h 2009-10-15 11:53:22 UTC (rev 212) +++ trunk/Community/General/Sources/ML/MLMatlabScriptWrapper/mlMatlabScriptWrapper.h 2009-10-19 11:57:24 UTC (rev 213) @@ -77,11 +77,11 @@ //! \return Region of input image needed to compute the region \c outSubImgBox on output \c outIndex. virtual SubImgBox calcInSubImageBox (int inIndex, const SubImgBox &outSubImgBox, int outIndex); - //! Request input image in fixed datatypes according to user choice + //! Request input image in basic datatypes according to user choice //! \param inIndex The input of which the datatype shall be set. //! \param props The properties of input image upon calling of method. //! \param outIndex The index of the output image. - virtual void calcInSubImageProps(int /*inIndex*/, InSubImageProps &/*props*/, int /*outIndex*/); + virtual void calcInSubImageProps(int inIndex, InSubImageProps &/*props*/, int /*outIndex*/); //! Calculates page \c outSubImg of output image with index \c outIndex by using \c inSubimgs. //! \param outSubImg The subimage of output image \c outIndex calculated from \c inSubImgs. @@ -98,29 +98,29 @@ // void calcOutSubImage (TSubImg<T> *outSubImg, int outIndex, TSubImg<T> *inSubImg1); // virtual void calcOutSubImage (SubImg *outSubImg, int outIndex, SubImg *inSubImg); - //@} private: // ---------------------------------------------------------- //@{ \name Module internal methods declarations // ---------------------------------------------------------- + //! Loads matlab script from a file, pastes it into script field and saves user written script. + bool _loadMatlabScriptFromFile(std::string& evaluateString); + //! Check if Matlab is started. + bool _checkMatlabIsStarted(); + //! Clear all variables that have been put in the Matlab workspace. + void _clearAllVariables(); + //! Copies input image data into Matlab. void _copyInputImageDataToMatlab(); //! Copies input XMarkerList into Matlab. void _copyInputXMarkerToMatlab(); - //! Loads matlab script from a file, pastes it into script field and saves user written script. - bool _loadMatlabScriptFromFile(std::string& evaluateString); - //! Gets XMarkerList from Matlab and copies results into output XMarkerList. + //! Copies XMarkerList from Matlab and copies results into output XMarkerList. void _getXMarkerBackFromMatlab(); //! Copies scalar values to matlab. void _copyInputScalarsToMatlab(); //! Copies scalar values from matlab. void _getScalarsBackFromMatlab(); - //! Check if Matlab is started. - bool _checkMatlabIsStarted(); - //! Clear all variables that have been put in the Matlab workspace. - void _clearAllVariables(); //! Copies string values to matlab. void _copyInputStringsToMatlab(); //! Copies string values from matlab. @@ -133,6 +133,7 @@ void _copyInputMatricesToMatlab(); //! Copies matrix values from matlab. void _getMatricesBackFromMatlab(); + // ---------------------------------------------------------- //@{ \name Module field declarations // ---------------------------------------------------------- @@ -163,7 +164,7 @@ StringField *_inXMarkerNameFld; StringField *_outXMarkerNameFld; //@} - + //! If true, the module updates on field changes. BoolField* _autoCalculationFld; //! Status messages. @@ -172,27 +173,23 @@ NotifyField* _calculateFld; //! Restart Matlab button. NotifyField* _restartMatlabFld; - //{@ Scalar float values. DoubleField *_scalarFld[6]; StringField *_scalarNameFld[6]; //@} - - //{@ String values. - StringField *_stringFld[6]; - StringField *_stringNameFld[6]; - //@} - - //{@ Matrix values. + //{@ Vector values. Vec4fField *_vectorFld[6]; StringField *_vectorNameFld[6]; //@} - //{@ Matrix values. MatrixField *_matrixFld[3]; StringField *_matrixNameFld[3]; //@} + //{@ String values. + StringField *_stringFld[6]; + StringField *_stringNameFld[6]; + //@} //! Implements interface for the runtime type system of the ML. ML_BASEOP_CLASS_HEADER(MatlabScriptWrapper) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bar...@us...> - 2009-10-15 11:53:30
|
Revision: 212 http://mevislabmodules.svn.sourceforge.net/mevislabmodules/?rev=212&view=rev Author: bartdedobbelaer Date: 2009-10-15 11:53:22 +0000 (Thu, 15 Oct 2009) Log Message: ----------- - Added matrix field titles Modified Paths: -------------- trunk/Community/General/Modules/ML/MLMatlabScriptWrapper/MLMatlabScriptWrapper.def Modified: trunk/Community/General/Modules/ML/MLMatlabScriptWrapper/MLMatlabScriptWrapper.def =================================================================== --- trunk/Community/General/Modules/ML/MLMatlabScriptWrapper/MLMatlabScriptWrapper.def 2009-10-15 11:05:04 UTC (rev 211) +++ trunk/Community/General/Modules/ML/MLMatlabScriptWrapper/MLMatlabScriptWrapper.def 2009-10-15 11:53:22 UTC (rev 212) @@ -171,15 +171,15 @@ Vertical { Vertical { Field matrixName0 {title = "Name:" expandX = yes} - TextView matrix0 {title = "" expandX = yes autoApply = Yes} + TextView matrix0 {title = "Value:" expandX = yes autoApply = Yes} } Vertical { Field matrixName1 {title = "Name:" expandX = yes} - TextView matrix1 {title = "" expandX = yes autoApply = Yes} + TextView matrix1 {title = "Value:" expandX = yes autoApply = Yes} } Vertical { Field matrixName2 {title = "Name:" expandX = yes} - TextView matrix2 {title = "" expandX = yes autoApply = Yes} + TextView matrix2 {title = "Value:" expandX = yes autoApply = Yes} } } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bar...@us...> - 2009-10-15 11:05:15
|
Revision: 211 http://mevislabmodules.svn.sourceforge.net/mevislabmodules/?rev=211&view=rev Author: bartdedobbelaer Date: 2009-10-15 11:05:04 +0000 (Thu, 15 Oct 2009) Log Message: ----------- - Transpose matrices during transfer - Initialized pointer 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 2009-10-15 07:50:46 UTC (rev 210) +++ trunk/Community/General/Sources/ML/MLMatlabScriptWrapper/mlMatlabScriptWrapper.cpp 2009-10-15 11:05:04 UTC (rev 211) @@ -899,7 +899,7 @@ // Internal loop. mxArray *temp = NULL; int tempsize = 0; - char *fieldVal; + char *fieldVal = NULL; // Get only output scalars. for(MLint i=0; i<6; i++) { @@ -988,10 +988,10 @@ execute<<_matrixNameFld[i]->getStringValue()<<"=["; mat4 mat = _matrixFld[i]->getMatrixValue(); - execute<<mat[0][0]<<","<<mat[1][0]<<","<<mat[2][0]<<","<<mat[3][0]<<";"; - execute<<mat[0][1]<<","<<mat[1][1]<<","<<mat[2][1]<<","<<mat[3][1]<<";"; - execute<<mat[0][2]<<","<<mat[1][2]<<","<<mat[2][2]<<","<<mat[3][2]<<";"; - execute<<mat[0][3]<<","<<mat[1][3]<<","<<mat[2][3]<<","<<mat[3][3]; + execute<<mat[0][0]<<","<<mat[0][1]<<","<<mat[0][2]<<","<<mat[0][3]<<";"; + execute<<mat[1][0]<<","<<mat[1][1]<<","<<mat[1][2]<<","<<mat[1][3]<<";"; + execute<<mat[2][0]<<","<<mat[2][1]<<","<<mat[2][2]<<","<<mat[2][3]<<";"; + execute<<mat[3][0]<<","<<mat[3][1]<<","<<mat[3][2]<<","<<mat[3][3]; execute<<"];"; } // Execute string and write input matrices into matlab. @@ -1017,7 +1017,10 @@ if(temp!=NULL) { double *fieldVal = static_cast<double*>(mxGetPr(temp)); - _matrixFld[i]->setMatrixValue(mat4(fieldVal)); + _matrixFld[i]->setMatrixValue(mat4(fieldVal[0],fieldVal[4],fieldVal[8],fieldVal[12], + fieldVal[1],fieldVal[5],fieldVal[9],fieldVal[13], + fieldVal[2],fieldVal[6],fieldVal[10],fieldVal[14], + fieldVal[3],fieldVal[7],fieldVal[11],fieldVal[15])); } } mxDestroyArray(temp); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bar...@us...> - 2009-10-15 07:50:55
|
Revision: 210 http://mevislabmodules.svn.sourceforge.net/mevislabmodules/?rev=210&view=rev Author: bartdedobbelaer Date: 2009-10-15 07:50:46 +0000 (Thu, 15 Oct 2009) Log Message: ----------- - Added support for strings, vectors and matrices. No checking is done on the dimensions of the returned vectors and matrices though. This is still to-do. Modified Paths: -------------- trunk/Community/General/Modules/ML/MLMatlabScriptWrapper/MLMatlabScriptWrapper.def trunk/Community/General/Sources/ML/MLMatlabScriptWrapper/mlMatlabScriptWrapper.cpp trunk/Community/General/Sources/ML/MLMatlabScriptWrapper/mlMatlabScriptWrapper.h Modified: trunk/Community/General/Modules/ML/MLMatlabScriptWrapper/MLMatlabScriptWrapper.def =================================================================== --- trunk/Community/General/Modules/ML/MLMatlabScriptWrapper/MLMatlabScriptWrapper.def 2009-10-08 10:47:25 UTC (rev 209) +++ trunk/Community/General/Modules/ML/MLMatlabScriptWrapper/MLMatlabScriptWrapper.def 2009-10-15 07:50:46 UTC (rev 210) @@ -79,37 +79,111 @@ Category Scalars{ Horizontal { Vertical { - //Box "Input scalars" { - Horizontal { - Field scalarName0 {title = "Name:" expandX = yes} - Field scalar0 {title = "Value:" expandX = yes} - } - Horizontal { - Field scalarName1 {title = "Name:" expandX = yes} - Field scalar1 {title = "Value:" expandX = yes} - } - Horizontal { - Field scalarName2 {title = "Name:" expandX = yes} - Field scalar2 {title = "Value:" expandX = yes} - } - //} - //Box "Output scalars" { - Horizontal { - Field scalarName3 {title = "Name:" expandX = yes} - Field scalar3 {title = "Value:" expandX = yes} - } - Horizontal { - Field scalarName4 {title = "Name:" expandX = yes} - Field scalar4 {title = "Value:" expandX = yes} - } - Horizontal { - Field scalarName5 {title = "Name:" expandX = yes} - Field scalar5 {title = "Value:" expandX = yes} - } - //} + Horizontal { + Field scalarName0 {title = "Name:" expandX = yes} + Field scalar0 {title = "Value:" expandX = yes} + } + Horizontal { + Field scalarName1 {title = "Name:" expandX = yes} + Field scalar1 {title = "Value:" expandX = yes} + } + Horizontal { + Field scalarName2 {title = "Name:" expandX = yes} + Field scalar2 {title = "Value:" expandX = yes} + } + Horizontal { + Field scalarName3 {title = "Name:" expandX = yes} + Field scalar3 {title = "Value:" expandX = yes} + } + Horizontal { + Field scalarName4 {title = "Name:" expandX = yes} + Field scalar4 {title = "Value:" expandX = yes} + } + Horizontal { + Field scalarName5 {title = "Name:" expandX = yes} + Field scalar5 {title = "Value:" expandX = yes} + } } } } + Category Strings { + Horizontal { + Vertical { + Horizontal { + Field stringName0 {title = "Name:" expandX = yes} + Field string0 {title = "Value:" expandX = yes} + } + Horizontal { + Field stringName1 {title = "Name:" expandX = yes} + Field string1 {title = "Value:" expandX = yes} + } + Horizontal { + Field stringName2 {title = "Name:" expandX = yes} + Field string2 {title = "Value:" expandX = yes} + } + Horizontal { + Field stringName3 {title = "Name:" expandX = yes} + Field string3 {title = "Value:" expandX = yes} + } + Horizontal { + Field stringName4 {title = "Name:" expandX = yes} + Field string4 {title = "Value:" expandX = yes} + } + Horizontal { + Field stringName5 {title = "Name:" expandX = yes} + Field string5 {title = "Value:" expandX = yes} + } + } + } + } + Category Vectors{ + Horizontal { + Vertical { + Horizontal { + Field vectorName0 {title = "Name:" expandX = yes} + Field vector0 {title = "Value:" expandX = yes} + } + Horizontal { + Field vectorName1 {title = "Name:" expandX = yes} + Field vector1 {title = "Value:" expandX = yes} + } + Horizontal { + Field vectorName2 {title = "Name:" expandX = yes} + Field vector2 {title = "Value:" expandX = yes} + } + Horizontal { + Field vectorName3 {title = "Name:" expandX = yes} + Field vector3 {title = "Value:" expandX = yes} + } + Horizontal { + Field vectorName4 {title = "Name:" expandX = yes} + Field vector4 {title = "Value:" expandX = yes} + } + Horizontal { + Field vectorName5 {title = "Name:" expandX = yes} + Field vector5 {title = "Value:" expandX = yes} + } + } + } + } + Category Matrices { + Horizontal { + Vertical { + Vertical { + Field matrixName0 {title = "Name:" expandX = yes} + TextView matrix0 {title = "" expandX = yes autoApply = Yes} + } + Vertical { + Field matrixName1 {title = "Name:" expandX = yes} + TextView matrix1 {title = "" expandX = yes autoApply = Yes} + } + Vertical { + Field matrixName2 {title = "Name:" expandX = yes} + TextView matrix2 {title = "" expandX = yes autoApply = Yes} + } + } + } + } } // Window } // MLModule MatlabScriptWrapper Modified: trunk/Community/General/Sources/ML/MLMatlabScriptWrapper/mlMatlabScriptWrapper.cpp =================================================================== --- trunk/Community/General/Sources/ML/MLMatlabScriptWrapper/mlMatlabScriptWrapper.cpp 2009-10-08 10:47:25 UTC (rev 209) +++ trunk/Community/General/Sources/ML/MLMatlabScriptWrapper/mlMatlabScriptWrapper.cpp 2009-10-15 07:50:46 UTC (rev 210) @@ -113,6 +113,42 @@ (_scalarNameFld[5] = fields->addString("scalarName5"))->setStringValue("scalar5"); (_scalarFld[5] = fields->addDouble("scalar5"))->setDoubleValue(0.0); + // Set string name and value fields. + (_stringNameFld[0] = fields->addString("stringName0"))->setStringValue("string0"); + (_stringFld[0] = fields->addString("string0"))->setStringValue(""); + (_stringNameFld[1] = fields->addString("stringName1"))->setStringValue("string1"); + (_stringFld[1] = fields->addString("string1"))->setStringValue(""); + (_stringNameFld[2] = fields->addString("stringName2"))->setStringValue("string2"); + (_stringFld[2] = fields->addString("string2"))->setStringValue(""); + (_stringNameFld[3] = fields->addString("stringName3"))->setStringValue("string3"); + (_stringFld[3] = fields->addString("string3"))->setStringValue(""); + (_stringNameFld[4] = fields->addString("stringName4"))->setStringValue("string4"); + (_stringFld[4] = fields->addString("string4"))->setStringValue(""); + (_stringNameFld[5] = fields->addString("stringName5"))->setStringValue("string5"); + (_stringFld[5] = fields->addString("string5"))->setStringValue(""); + + // Set vector name and value fields. + (_vectorNameFld[0] = fields->addString("vectorName0"))->setStringValue("vector0"); + (_vectorFld[0] = fields->addVec4f("vector0"))->setStringValue("0 0 0 0"); + (_vectorNameFld[1] = fields->addString("vectorName1"))->setStringValue("vector1"); + (_vectorFld[1] = fields->addVec4f("vector1"))->setStringValue("0 0 0 0"); + (_vectorNameFld[2] = fields->addString("vectorName2"))->setStringValue("vector2"); + (_vectorFld[2] = fields->addVec4f("vector2"))->setStringValue("0 0 0 0"); + (_vectorNameFld[3] = fields->addString("vectorName3"))->setStringValue("vector3"); + (_vectorFld[3] = fields->addVec4f("vector3"))->setStringValue("0 0 0 0"); + (_vectorNameFld[4] = fields->addString("vectorName4"))->setStringValue("vector4"); + (_vectorFld[4] = fields->addVec4f("vector4"))->setStringValue("0 0 0 0"); + (_vectorNameFld[5] = fields->addString("vectorName5"))->setStringValue("vector5"); + (_vectorFld[5] = fields->addVec4f("vector5"))->setStringValue("0 0 0 0"); + + // Set matrix name and value fields. + (_matrixNameFld[0] = fields->addString("matrixName0"))->setStringValue("matrix0"); + (_matrixFld[0] = fields->addMatrix("matrix0"))->setStringValue("1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1"); + (_matrixNameFld[1] = fields->addString("matrixName1"))->setStringValue("matrix1"); + (_matrixFld[1] = fields->addMatrix("matrix1"))->setStringValue("1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1"); + (_matrixNameFld[2] = fields->addString("matrixName2"))->setStringValue("matrix2"); + (_matrixFld[2] = fields->addMatrix("matrix2"))->setStringValue("1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1"); + //! Reactivate calls of handleNotification on field changes. handleNotificationOn(); @@ -215,6 +251,12 @@ _copyInputImageDataToMatlab(); // Copy scalar values to matlab. _copyInputScalarsToMatlab(); + // Copy string values to matlab. + _copyInputStringsToMatlab(); + // Copy vector values to matlab. + _copyInputVectorsToMatlab(); + // Copy matrix values to matlab. + _copyInputMatricesToMatlab(); // Insert at the end of the script variable to proof execution status @@ -255,7 +297,43 @@ _scalarFld[k]->notifyAttachments(); } } + // 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) { + tmpstrings[k] = _stringFld[k]->getStringValue(); + } + _getStringsBackFromMatlab(); + for(int k=0; k<6; ++k) { + if(tmpstrings[k] == _stringFld[k]->getStringValue()) { + _stringFld[k]->notifyAttachments(); + } + } + // 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(); + } + _getVectorsBackFromMatlab(); + for(int k=0; k<6; ++k) { + if(tmpstrings[k] == _vectorFld[k]->getStringValue()) { + _vectorFld[k]->notifyAttachments(); + } + } + + // 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(); + } + _getMatricesBackFromMatlab(); + for(int k=0; k<3; ++k) { + if(tmpstrings[k] == _matrixFld[k]->getStringValue()) { + _matrixFld[k]->notifyAttachments(); + } + } + // Notify image attachments that are new images calculated so that they // update themselves and call the calcOutSubImage() getOutField(0)->notifyAttachments(); @@ -786,6 +864,166 @@ temp = NULL; } +//! Copies string values to matlab. +void MatlabScriptWrapper::_copyInputStringsToMatlab() +{ + // Check if Matlab is started. + if (!_checkMatlabIsStarted()) + { + std::cerr << "_copyInputStringsToMatlab(): Cannot find matlab engine!" << std::endl << std::flush; + return; + } + // Internal loop. + MLint i = 0; + // Compose string that contains input scalars. + std::ostringstream execute; + // Put only input scalars into matlab. + for(i=0; i<6; i++) + { + execute<<_stringNameFld[i]->getStringValue()<<"='"<<(_stringFld[i]->getStringValue())<<"'\n"; + } + // Execute string and write input scalars into matlab. + engEvalString(m_pEngine, execute.str().c_str()); +} + +//! Copies string values from matlab. +void MatlabScriptWrapper::_getStringsBackFromMatlab() +{ + // Check if Matlab is started. + if (!_checkMatlabIsStarted()) + { + std::cerr << "_getStringsBackFromMatlab(): Cannot finding matlab engine!" << std::endl << std::flush; + return; + } + + // Internal loop. + mxArray *temp = NULL; + int tempsize = 0; + char *fieldVal; + // Get only output scalars. + for(MLint i=0; i<6; i++) + { + temp = engGetVariable(m_pEngine, (_stringNameFld[i]->getStringValue()).c_str()); + if(temp!=NULL) + { + tempsize = mxGetN(temp)+1; + ML_CHECK_NEW(fieldVal,char[tempsize]); + mxGetString(temp,fieldVal,tempsize); + _stringFld[i]->setStringValue(fieldVal); + ML_DELETE(fieldVal); + } + } + mxDestroyArray(temp); + temp = NULL; +} + +//! Copy input vectors to matlab. +void MatlabScriptWrapper::_copyInputVectorsToMatlab() +{ + // Proof if Matlab is started. + if (!_checkMatlabIsStarted()) + { + std::cerr << "_copyInputVectorsToMatlab(): Cannot finding matlab engine!" << std::endl << std::flush; + return; + } + // Internal loop. + MLint i = 0; + // Compose string that contains input vectors. + std::ostringstream execute; + // Put only input vectors into matlab. + for(i=0; i<6; i++) + { + execute<<_vectorNameFld[i]->getStringValue()<<"=["; + + vec4 vec = _vectorFld[i]->getVec4fValue(); + execute<<vec[0]<<","<<vec[1]<<","<<vec[2]<<","<<vec[3]; + execute<<"];"; + } + // Execute string and write input vectors into matlab. + engEvalString(m_pEngine, execute.str().c_str()); +} + +//! Copies vector values from matlab. +void MatlabScriptWrapper::_getVectorsBackFromMatlab() +{ + // Check if Matlab is started. + if (!_checkMatlabIsStarted()) + { + std::cerr << "_getVectorssBackFromMatlab(): Cannot finding matlab engine!" << std::endl << std::flush; + return; + } + + // Internal loop. + mxArray *temp = NULL; + // Get only output vectors. + for(MLint i=0; i<6; i++) + { + temp = engGetVariable(m_pEngine, (_vectorNameFld[i]->getStringValue()).c_str()); + if(temp!=NULL) + { + double *fieldVal = static_cast<double*>(mxGetPr(temp)); + _vectorFld[i]->setVec4fValue(vec4(fieldVal[0],fieldVal[1],fieldVal[2],fieldVal[3])); + } + } + mxDestroyArray(temp); + temp = NULL; +} + +//! Copy input matrices to matlab. +void MatlabScriptWrapper::_copyInputMatricesToMatlab() +{ + // Proof if Matlab is started. + if (!_checkMatlabIsStarted()) + { + std::cerr << "_copyInputMatricesToMatlab(): Cannot finding matlab engine!" << std::endl << std::flush; + return; + } + // Internal loop. + MLint i = 0; + // Compose string that contains input matrices. + std::ostringstream execute; + // Put only input matrices into matlab. + for(i=0; i<3; i++) + { + execute<<_matrixNameFld[i]->getStringValue()<<"=["; + + mat4 mat = _matrixFld[i]->getMatrixValue(); + execute<<mat[0][0]<<","<<mat[1][0]<<","<<mat[2][0]<<","<<mat[3][0]<<";"; + execute<<mat[0][1]<<","<<mat[1][1]<<","<<mat[2][1]<<","<<mat[3][1]<<";"; + execute<<mat[0][2]<<","<<mat[1][2]<<","<<mat[2][2]<<","<<mat[3][2]<<";"; + execute<<mat[0][3]<<","<<mat[1][3]<<","<<mat[2][3]<<","<<mat[3][3]; + execute<<"];"; + } + // Execute string and write input matrices into matlab. + engEvalString(m_pEngine, execute.str().c_str()); +} + +//! Copies matrix values from matlab. +void MatlabScriptWrapper::_getMatricesBackFromMatlab() +{ + // Check if Matlab is started. + if (!_checkMatlabIsStarted()) + { + std::cerr << "_getMatricesBackFromMatlab(): Cannot finding matlab engine!" << std::endl << std::flush; + return; + } + + // Internal loop. + mxArray *temp = NULL; + // Get only output matrices. + for(MLint i=0; i<3; i++) + { + temp = engGetVariable(m_pEngine, (_matrixNameFld[i]->getStringValue()).c_str()); + if(temp!=NULL) + { + double *fieldVal = static_cast<double*>(mxGetPr(temp)); + _matrixFld[i]->setMatrixValue(mat4(fieldVal)); + } + } + mxDestroyArray(temp); + temp = NULL; +} + //! Check if Matlab is started. bool MatlabScriptWrapper::_checkMatlabIsStarted() { @@ -810,6 +1048,17 @@ clearString << _scalarNameFld[i]->getStringValue() << " "; } + // Clear strings + for(int i=0; i<6; i++) { + clearString << _stringNameFld[i]->getStringValue() << " "; + } + + // Clear matrices + for(int i=0; i<3; i++) { + clearString << _matrixNameFld[i]->getStringValue() << " "; + } + + // Clear input images for(int i=0; i<3; i++) { clearString << _inDataNameFld[i]->getStringValue() << " "; Modified: trunk/Community/General/Sources/ML/MLMatlabScriptWrapper/mlMatlabScriptWrapper.h =================================================================== --- trunk/Community/General/Sources/ML/MLMatlabScriptWrapper/mlMatlabScriptWrapper.h 2009-10-08 10:47:25 UTC (rev 209) +++ trunk/Community/General/Sources/ML/MLMatlabScriptWrapper/mlMatlabScriptWrapper.h 2009-10-15 07:50:46 UTC (rev 210) @@ -121,6 +121,18 @@ bool _checkMatlabIsStarted(); //! Clear all variables that have been put in the Matlab workspace. void _clearAllVariables(); + //! Copies string values to matlab. + void _copyInputStringsToMatlab(); + //! Copies string values from matlab. + void _getStringsBackFromMatlab(); + //! Copies vector values to matlab. + void _copyInputVectorsToMatlab(); + //! Copies vector values from matlab. + void _getVectorsBackFromMatlab(); + //! Copies matrix values to matlab. + void _copyInputMatricesToMatlab(); + //! Copies matrix values from matlab. + void _getMatricesBackFromMatlab(); // ---------------------------------------------------------- //@{ \name Module field declarations // ---------------------------------------------------------- @@ -167,6 +179,21 @@ StringField *_scalarNameFld[6]; //@} + //{@ String values. + StringField *_stringFld[6]; + StringField *_stringNameFld[6]; + //@} + + //{@ Matrix values. + Vec4fField *_vectorFld[6]; + StringField *_vectorNameFld[6]; + //@} + + //{@ Matrix values. + MatrixField *_matrixFld[3]; + StringField *_matrixNameFld[3]; + //@} + //! Implements interface for the runtime type system of the ML. ML_BASEOP_CLASS_HEADER(MatlabScriptWrapper) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tm...@us...> - 2009-10-08 10:47:40
|
Revision: 209 http://mevislabmodules.svn.sourceforge.net/mevislabmodules/?rev=209&view=rev Author: tmoench Date: 2009-10-08 10:47:25 +0000 (Thu, 08 Oct 2009) Log Message: ----------- further fixes to remove warnings and changes in the example network Modified Paths: -------------- trunk/Community/General/Modules/ML/UMDsplitCurveList/networks/UMDsplitCurveListExample.mlab trunk/Community/General/Sources/ML/UMDsplitCurveList/mlUMDsplitCurveList.cpp Modified: trunk/Community/General/Modules/ML/UMDsplitCurveList/networks/UMDsplitCurveListExample.mlab =================================================================== --- trunk/Community/General/Modules/ML/UMDsplitCurveList/networks/UMDsplitCurveListExample.mlab 2009-10-08 08:25:24 UTC (rev 208) +++ trunk/Community/General/Modules/ML/UMDsplitCurveList/networks/UMDsplitCurveListExample.mlab 2009-10-08 10:47:25 UTC (rev 209) @@ -2,6 +2,200 @@ network { watchlist = "" } +module WEMInfo { + internal { + frame = "37 109 88 56" + moduleGroupName = "" + windows { + window _default { + geometry = "535 590 464 326" + sizeHint = "464 326" + wasOpen = no + wasActive = no + } + window _automatic { + geometry = "1729 290 307 440" + sizeHint = "307 440" + wasOpen = no + wasActive = no + } + } + } + fields { + instanceName = WEMInfo3 + isProcessing = FALSE + elapsedTime = 0.03099999949 + autoApply = TRUE + autoUpdate = TRUE + autoClear = TRUE + listenToFinishingNotifications = TRUE + listenToRepaintNotifications = TRUE + listenToSelectionChangedNotifications = TRUE + WEMs = "4@" + selectedWEMs = "" + informationFieldsValid = TRUE + numNodes = 3980 + numEdges = 12000 + numFaces = 8000 + uniqueId = 4 + patchType = Triangles + hasEdges = TRUE + surfaceArea = 9088.235352 + surfaceVolume = 11417.07031 + label = "" + description = "" + show = TRUE + editable = TRUE + colorMode = "General " + drawFaces = TRUE + useFaceAmbientColor = TRUE + faceAmbientColor = "0.266667008399963 0.266667008399963 0.266667008399963" + useFaceDiffuseColor = TRUE + faceDiffuseColor = "0.792156994342804 0.792156994342804 0.792156994342804" + useFaceSpecularColor = TRUE + faceSpecularColor = "0.0666669979691505 0.0666669979691505 0.0666669979691505" + faceAlphaValue = 1 + faceShininessValue = 1 + drawFaceNormals = FALSE + faceNormalsColor = "1 1 1" + faceNormalsScale = 1 + drawEdges = FALSE + edgeColor = "0 0 0" + usePolygonOffset = FALSE + lineWidth = 1 + useEdgeColoringMode = FALSE + drawNodes = FALSE + nodeColor = "1 1 1" + drawNodeNormals = FALSE + nodeNormalsColor = "1 1 1" + nodeNormalsScale = 1 + pointSize = 1 + nodeRenderingMode = Normal + drawBoundingBox = FALSE + boundingBoxMode = "Axis Aligned" + boundingBoxColor = "1 1 1" + center = "32.18994140625 32.51465225219727 12.5" + minimum = "0.3798865675926208 1.029304265975952 0" + maximum = "64 64 25" + size = "63.62011343240738 62.97069573402405 25" + radius = 46.46995926 + mainAxisCenter = "36.70425415039062 31.73256301879883 11.25884342193604" + xMainAxis = "0.8256326913833618 0.5631536841392517 -0.0344751663506031" + yMainAxis = "-0.5586679577827454 0.8245398998260498 0.08957722038030624" + zMainAxis = "0.07887189090251923 -0.05469771102070808 0.995383083820343" + xExt = 76.63206482 + yExt = 76.86981964 + zExt = 28.9629631 + primitiveValueLists = "LUT,Quadric Error,Face Area,Edge Length,Face Quality,Node Curvature,Node Valence" + selectedPrimitiveValueList = "Face Quality" + primitiveValueListValid = TRUE + minPrimitiveValueList = 0 + maxPrimitiveValueList = 99.99987030029297 + meanPrimitiveValueList = 91.96286586308479 + primitiveValueListUnits = % + edgeLengthUnits = mm + faceAreaUnits = mm2 + curveScaleFactor = 1 + selectedTab = 2 + } +} +module WEMInfo { + internal { + frame = "-67 117 88 56" + moduleGroupName = "" + windows { + window _default { + geometry = "535 590 466 326" + sizeHint = "466 326" + wasOpen = no + wasActive = no + } + window _automatic { + geometry = "1729 290 307 440" + sizeHint = "307 440" + wasOpen = no + wasActive = no + } + } + } + fields { + instanceName = WEMInfo2 + isProcessing = FALSE + elapsedTime = 0.04699999839 + autoApply = TRUE + autoUpdate = TRUE + autoClear = TRUE + listenToFinishingNotifications = TRUE + listenToRepaintNotifications = TRUE + listenToSelectionChangedNotifications = TRUE + WEMs = "4@" + selectedWEMs = "" + informationFieldsValid = TRUE + numNodes = 3980 + numEdges = 12000 + numFaces = 8000 + uniqueId = 4 + patchType = Triangles + hasEdges = TRUE + surfaceArea = 9088.235352 + surfaceVolume = 11417.07031 + label = "" + description = "" + show = TRUE + editable = TRUE + colorMode = "General " + drawFaces = TRUE + useFaceAmbientColor = TRUE + faceAmbientColor = "0.266667008399963 0.266667008399963 0.266667008399963" + useFaceDiffuseColor = TRUE + faceDiffuseColor = "0.792156994342804 0.792156994342804 0.792156994342804" + useFaceSpecularColor = TRUE + faceSpecularColor = "0.0666669979691505 0.0666669979691505 0.0666669979691505" + faceAlphaValue = 1 + faceShininessValue = 1 + drawFaceNormals = FALSE + faceNormalsColor = "1 1 1" + faceNormalsScale = 1 + drawEdges = FALSE + edgeColor = "0 0 0" + usePolygonOffset = FALSE + lineWidth = 1 + useEdgeColoringMode = FALSE + drawNodes = FALSE + nodeColor = "1 1 1" + drawNodeNormals = FALSE + nodeNormalsColor = "1 1 1" + nodeNormalsScale = 1 + pointSize = 1 + nodeRenderingMode = Normal + drawBoundingBox = FALSE + boundingBoxMode = "Axis Aligned" + boundingBoxColor = "1 1 1" + center = "32.18994140625 32.51465225219727 12.5" + minimum = "0.3798865675926208 1.029304265975952 0" + maximum = "64 64 25" + size = "63.62011343240738 62.97069573402405 25" + radius = 46.46995926 + mainAxisCenter = "36.70425415039062 31.73256301879883 11.25884342193604" + xMainAxis = "0.8256326913833618 0.5631536841392517 -0.0344751663506031" + yMainAxis = "-0.5586679577827454 0.8245398998260498 0.08957722038030624" + zMainAxis = "0.07887189090251923 -0.05469771102070808 0.995383083820343" + xExt = 76.63206482 + yExt = 76.86981964 + zExt = 28.9629631 + primitiveValueLists = "LUT,Quadric Error,Face Area,Edge Length,Face Quality,Node Curvature,Node Valence" + selectedPrimitiveValueList = "Edge Length" + primitiveValueListValid = TRUE + minPrimitiveValueList = 0 + maxPrimitiveValueList = 8.441550254821777 + meanPrimitiveValueList = 1.72643531275789 + primitiveValueListUnits = mm + edgeLengthUnits = mm + faceAreaUnits = mm2 + curveScaleFactor = 1 + selectedTab = 2 + } +} module UMDsplitCurveList { internal { frame = "-187 -67 136 56" @@ -10,15 +204,15 @@ window _default { geometry = "118 141 500 31" sizeHint = "500 31" - wasOpen = yes + wasOpen = no wasActive = no } } } fields { instanceName = UMDsplitCurveList - AvailableCurvesStr = "1: Face Area,2: Face Area" - AvailableCurves = "2: Face Area" + AvailableCurvesStr = "1: Face Area,2: Face Area,3: Edge Length,4: Face Quality" + AvailableCurves = "3: Edge Length" } } module LocalImage { @@ -29,7 +223,7 @@ fields { instanceName = LocalImage name = $(DemoDataPath)/Bone.tiff - trueName = "C:/Program Files/MeVisLab2.0VC9/Packages/MeVisLab/Resources/DemoData/Bone.tiff" + trueName = "C:/Program Files/MeVisLab2.0VC9-64/Packages/MeVisLab/Resources/DemoData/Bone.tiff" autoLoad = TRUE status = "File open" } @@ -51,7 +245,7 @@ fields { instanceName = WEMIsoSurface isProcessing = FALSE - elapsedTime = 0.2809999883 + elapsedTime = 0.5929999948 id = 0 autoApply = TRUE autoUpdate = TRUE @@ -131,7 +325,7 @@ fields { instanceName = WEMInfo isProcessing = FALSE - elapsedTime = 0.07800000161 + elapsedTime = 0.03099999949 autoApply = TRUE autoUpdate = TRUE autoClear = TRUE @@ -147,7 +341,7 @@ uniqueId = 2 patchType = Triangles hasEdges = TRUE - surfaceArea = 9452.926758 + surfaceArea = 9452.927734 surfaceVolume = 11593.98047 label = "" description = "" @@ -186,11 +380,11 @@ maximum = "64 64 25" size = "64 63.01695477962494 25" radius = 46.61581421 - mainAxisCenter = "37.00667572021484 31.91140174865723 11.19961833953857" - xMainAxis = "0.8188340067863464 0.5700684189796448 -0.06732727587223053" + mainAxisCenter = "37.00667190551758 31.91140556335449 11.19961738586426" + xMainAxis = "0.8188340067863464 0.5700684189796448 -0.06732726097106934" yMainAxis = "-0.5646404027938843 0.8210079073905945 0.08442250639200211" - zMainAxis = "0.1034028306603432 -0.03111230954527855 0.994152843952179" - xExt = 76.54521942 + zMainAxis = "0.103402815759182 -0.03111232072114944 0.994152843952179" + xExt = 76.54521179 yExt = 77.21954346 zExt = 29.9910202 primitiveValueLists = "LUT,Edge Length,Face Area,Face Quality,Node Curvature,Node Valence" @@ -198,7 +392,7 @@ primitiveValueListValid = TRUE minPrimitiveValueList = 0 maxPrimitiveValueList = 1.142393827438354 - meanPrimitiveValueList = 0.35443971761418 + meanPrimitiveValueList = 0.3544397210796681 primitiveValueListUnits = mm2 edgeLengthUnits = mm faceAreaUnits = mm2 @@ -222,10 +416,10 @@ fields { instanceName = Diagram2D minX = 0 - maxX = 13 + maxX = 9 autoRangeX = TRUE minY = 0 - maxY = 47.28749847 + maxY = 99.92875671 autoRangeY = TRUE axisColor = "1 1 1" axisRotation = LeftBottom @@ -258,8 +452,8 @@ shift = IGNORED ctrl = IGNORED alt = IGNORED - mousePosX = -0.9825582504 - mousePosY = 53.12361526 + mousePosX = -0.6802326441 + mousePosY = 53.3061676 mousePosValid = TRUE curveSelection = Diagram selectionTolerance = 5 @@ -276,7 +470,7 @@ moduleGroupName = "" windows { window _viewer { - geometry = "675 102 400 400" + geometry = "978 171 400 400" sizeHint = "400 400" wasOpen = yes wasActive = no @@ -331,7 +525,7 @@ fields { instanceName = WEMInfo1 isProcessing = FALSE - elapsedTime = 0.03200000152 + elapsedTime = 0.01600000076 autoApply = TRUE autoUpdate = TRUE autoClear = TRUE @@ -347,8 +541,8 @@ uniqueId = 4 patchType = Triangles hasEdges = TRUE - surfaceArea = 9087.744141 - surfaceVolume = 11418.16016 + surfaceArea = 9088.235352 + surfaceVolume = 11417.07031 label = "" description = "" show = TRUE @@ -386,19 +580,19 @@ maximum = "64 64 25" size = "63.62011343240738 62.97069573402405 25" radius = 46.46995926 - mainAxisCenter = "36.68818664550781 31.71071624755859 11.26501941680908" - xMainAxis = "0.8260845541954041 0.5626350045204163 -0.03203367441892624" - yMainAxis = "-0.5583527684211731 0.8248476982116699 0.088703952729702" - zMainAxis = "0.07633084803819656 -0.05539087951183319 0.9955427646636963" - xExt = 76.63578033 - yExt = 76.85345459 - zExt = 28.82315826 + mainAxisCenter = "36.70425415039062 31.73256301879883 11.25884342193604" + xMainAxis = "0.8256326913833618 0.5631536841392517 -0.0344751663506031" + yMainAxis = "-0.5586679577827454 0.8245398998260498 0.08957722038030624" + zMainAxis = "0.07887189090251923 -0.05469771102070808 0.995383083820343" + xExt = 76.63206482 + yExt = 76.86981964 + zExt = 28.9629631 primitiveValueLists = "LUT,Quadric Error,Edge Length,Face Area,Face Quality,Node Curvature,Node Valence" selectedPrimitiveValueList = "Face Area" primitiveValueListValid = TRUE minPrimitiveValueList = 0 - maxPrimitiveValueList = 12.19644355773926 - meanPrimitiveValueList = 1.135967058496957 + maxPrimitiveValueList = 8.992372512817383 + meanPrimitiveValueList = 1.136028095684553 primitiveValueListUnits = mm2 edgeLengthUnits = mm faceAreaUnits = mm2 @@ -620,7 +814,7 @@ fields { instanceName = WEMReducePolygons isProcessing = FALSE - elapsedTime = 1.281000018 + elapsedTime = 1.980999947 id = 0 autoApply = TRUE autoUpdate = TRUE @@ -666,7 +860,7 @@ modifyAttributes = FALSE targetReduction = 70 smooth = TRUE - numEdgeCollapses = 9101 + numEdgeCollapses = 9097 reduction = 70 useExpertMode = FALSE vertexPlacementMode = Middle @@ -749,7 +943,7 @@ window _viewer { geometry = "598 535 566 400" sizeHint = "400 400" - wasOpen = yes + wasOpen = no wasActive = no } } @@ -917,11 +1111,13 @@ } } connections { + WEMInfo3.inWEM = WEMReducePolygons.outWEM + WEMInfo2.inWEM = WEMReducePolygons.outWEM UMDsplitCurveList.inCurveList = CatCurves.outCurveList WEMIsoSurface.input0 = Subimage.output0 WEMInfo.inWEM = WEMIsoSurface.outWEM Diagram2D.inStylePalette = StylePalette.outStylePalette - Diagram2D.inCurveList = UMDsplitCurveList.outCurveData + Diagram2D.inCurveList = UMDsplitCurveList.outCurveList1 Diagram2D.diagramTitleString = WEMInfo.selectedPrimitiveValueList SoRenderArea.children = Diagram2D.outNode WEMInfo1.inWEM = WEMReducePolygons.outWEM @@ -929,6 +1125,8 @@ WEMInfo1.selectedPrimitiveValueList = WEMInfo.selectedPrimitiveValueList CatCurves.inCurve1 = WEMInfo.outputCurveData CatCurves.inCurve2 = WEMInfo1.outputCurveData + CatCurves.inCurve3 = WEMInfo2.outputCurveData + CatCurves.inCurve4 = WEMInfo3.outputCurveData Subimage.input0 = LocalImage.outImage WEMReducePolygons.inWEM = WEMIsoSurface.outWEM SoWEMRenderer.inWEM = WEMIsoSurface.outWEM Modified: trunk/Community/General/Sources/ML/UMDsplitCurveList/mlUMDsplitCurveList.cpp =================================================================== --- trunk/Community/General/Sources/ML/UMDsplitCurveList/mlUMDsplitCurveList.cpp 2009-10-08 08:25:24 UTC (rev 208) +++ trunk/Community/General/Sources/ML/UMDsplitCurveList/mlUMDsplitCurveList.cpp 2009-10-08 10:47:25 UTC (rev 209) @@ -25,7 +25,6 @@ return s.str() ; } - //! Implements code for the runtime type system of the ML ML_BASEOP_CLASS_SOURCE(UMDsplitCurveList, BaseOp); @@ -110,7 +109,7 @@ else _availableCurvesStrFld->setStringValue(""); // check again if input is available - if ((_inputCurveListFld->getBaseValue() != NULL) && (_inputCurveList->getNumCurves() > 0) && inputOK) + if (((field == _availableCurvesFld) ||(field == _inputCurveListFld)) && (_inputCurveListFld->getBaseValue() != NULL) && (_inputCurveList->getNumCurves() > 0) && inputOK) { // clear the output curveLists and the curveData _curveList1.getCurveList().clear(); @@ -122,7 +121,7 @@ bool found = false; // run over the available curves ... - for (int i=0; i<_availableCurvesVec.size(); i++) + for (unsigned int i=0; i<_availableCurvesVec.size(); i++) { // check which curve has been selected if (_availableCurvesVec[i].compare(_availableCurvesFld->getStringValue()) == 0) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tm...@us...> - 2009-10-08 08:25:40
|
Revision: 208 http://mevislabmodules.svn.sourceforge.net/mevislabmodules/?rev=208&view=rev Author: tmoench Date: 2009-10-08 08:25:24 +0000 (Thu, 08 Oct 2009) Log Message: ----------- fix for building on linux Modified Paths: -------------- trunk/Community/General/Sources/ML/UMDsplitCurveList/mlUMDsplitCurveList.cpp Modified: trunk/Community/General/Sources/ML/UMDsplitCurveList/mlUMDsplitCurveList.cpp =================================================================== --- trunk/Community/General/Sources/ML/UMDsplitCurveList/mlUMDsplitCurveList.cpp 2009-10-01 09:08:50 UTC (rev 207) +++ trunk/Community/General/Sources/ML/UMDsplitCurveList/mlUMDsplitCurveList.cpp 2009-10-08 08:25:24 UTC (rev 208) @@ -83,7 +83,7 @@ _availableCurvesVec.clear(); // if the input is of type "CurveList" .... - if (strcmpi(_inputCurveListFld->getBaseValue()->getTypeIdName(),"CurveList")==0) + if (strncasecmp(_inputCurveListFld->getBaseValue()->getTypeIdName(),"CurveList",9)==0) { // set status inputOK = true; @@ -98,8 +98,6 @@ if (i!=0) _availableCurves.append(","); // append the strings to both: the output string and a similar string-vector - //_availableCurves.append(asString(i+1,0)); - //_availableCurves.append(": "); _availableCurves.append(asString(i+1,0) + ": " + _inputCurveList->getCurveList()[i]->getTitle().c_str()); _availableCurvesVec.push_back(asString(i+1,0) + ": " + _inputCurveList->getCurveList()[i]->getTitle().c_str()); @@ -120,7 +118,7 @@ _curveData.clear(); // status and index variables - int selectionIdx=0; + unsigned int selectionIdx=0; bool found = false; // run over the available curves ... This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tm...@us...> - 2009-10-01 09:09:42
|
Revision: 207 http://mevislabmodules.svn.sourceforge.net/mevislabmodules/?rev=207&view=rev Author: tmoench Date: 2009-10-01 09:08:50 +0000 (Thu, 01 Oct 2009) Log Message: ----------- Added module UMDsplitCurveList Added Paths: ----------- trunk/Community/General/Modules/ML/UMDsplitCurveList/ trunk/Community/General/Modules/ML/UMDsplitCurveList/UMDsplitCurveList.def trunk/Community/General/Modules/ML/UMDsplitCurveList/html/ trunk/Community/General/Modules/ML/UMDsplitCurveList/html/UMDsplitCurveList.html trunk/Community/General/Modules/ML/UMDsplitCurveList/networks/ trunk/Community/General/Modules/ML/UMDsplitCurveList/networks/UMDsplitCurveListExample.mlab trunk/Community/General/Sources/ML/UMDsplitCurveList/ trunk/Community/General/Sources/ML/UMDsplitCurveList/UMDsplitCurveList.bat trunk/Community/General/Sources/ML/UMDsplitCurveList/UMDsplitCurveList.pro trunk/Community/General/Sources/ML/UMDsplitCurveList/UMDsplitCurveList.sh trunk/Community/General/Sources/ML/UMDsplitCurveList/UMDsplitCurveListInit.cpp trunk/Community/General/Sources/ML/UMDsplitCurveList/UMDsplitCurveListInit.h trunk/Community/General/Sources/ML/UMDsplitCurveList/UMDsplitCurveListSystem.h trunk/Community/General/Sources/ML/UMDsplitCurveList/mlUMDsplitCurveList.cpp trunk/Community/General/Sources/ML/UMDsplitCurveList/mlUMDsplitCurveList.h Added: trunk/Community/General/Modules/ML/UMDsplitCurveList/UMDsplitCurveList.def =================================================================== --- trunk/Community/General/Modules/ML/UMDsplitCurveList/UMDsplitCurveList.def (rev 0) +++ trunk/Community/General/Modules/ML/UMDsplitCurveList/UMDsplitCurveList.def 2009-10-01 09:08:50 UTC (rev 207) @@ -0,0 +1,45 @@ +//---------------------------------------------------------------------------------- +//! UMDsplitCurveList module definitions. +/*! +// \file UMDsplitCurveList.def +// \author Tobias M\xF6nch +// \date 2009-08-05 +*/ +//---------------------------------------------------------------------------------- + + +//---------------------------------------------------------------------------------- +// MLModule UMDsplitCurveList +//---------------------------------------------------------------------------------- +MLModule UMDsplitCurveList { + DLL = "UMDsplitCurveList" + + genre = "" + author = "Tobias M\xF6nch, Sylvia Gla\xDFer" + status = stable + comment = "Splits a given CurveList into the selected curve and the remaining curveLists." + keywords = "CurveData, CurveList" + seeAlso = "" + documentation = "$(LOCAL)/html/UMDsplitCurveList.html" + exampleNetwork = "$(LOCAL)/networks/UMDsplitCurveListExample.mlab" + + Window { + expandX = True + width = 500 + Category { + width = 500 + expandX = True + alignX = Left + + Horizontal { + Label {title = "Select Curve: "} + ComboBox AvailableCurves{ + comboField = AvailableCurvesStr + comboSeparator = "," + editable = False + } + } + } + } +} // MLModule UMDsplitCurveList + Added: trunk/Community/General/Modules/ML/UMDsplitCurveList/html/UMDsplitCurveList.html =================================================================== --- trunk/Community/General/Modules/ML/UMDsplitCurveList/html/UMDsplitCurveList.html (rev 0) +++ trunk/Community/General/Modules/ML/UMDsplitCurveList/html/UMDsplitCurveList.html 2009-10-01 09:08:50 UTC (rev 207) @@ -0,0 +1,141 @@ +<!DOCTYPE html PUBLIC "-//w3c//dtd html 4.0 transitional//en"> +<html> +<head> + + + + + <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> + + + + + <meta name="GENERATOR" content="Mozilla/4.78 [en] (Windows NT 5.0; U) [Netscape]"> + + + + + <meta name="Description" content="MeVisLab module help page template"> + + + + + <title>Module Help Page</title> +</head> + + +<body> + + + +<center><a href="#Purpose">Purpose</a> <a href="#Usage">Usage</a> +<a href="#Details">Details</a> <a href="#Inputs">Inputs</a> +<a href="#Outputs">Outputs</a> <a href="#Parameters">Parameters</a> +<a href="#EventInteract">Events&Interaction</a> <a href="#Example">Example</a> +<a href="#Tips&Tricks">Tips&Tricks</a> <a href="#KnownBugs">Known +Bugs</a> +<hr width="100%"></center> + + + +<h2> +TestFilter</h2> + + + +<h3> +<a name="Purpose"></a>Purpose</h3> + + + +<blockquote>The module allows to select a single curve from a collection of several curves (CurveList) and therefor splits the input CurveList into (1) the selected curve, (2) the curves preceding the selection and (3) the remaining curves.</blockquote> + + + +<h3> +<a name="Usage"></a>Usage</h3> + + + +<blockquote>Just connect a module providing a CurveList and then select the desired curve using the GUI<br> + +</blockquote> + + + +<h3> +<a name="Details"></a>Details</h3> + + + +<blockquote> - </blockquote> + + + +<h3> +<a name="Inputs"></a>Inputs</h3> + + + +<blockquote>There is only one input for the required CurveList.</blockquote> + + + +<h3> +<a name="Outputs"></a>Outputs</h3> + + + +<blockquote>The module provides three outputs:<br> +(1) <i>outCurveList1</i> - the list of curves from the input CurveList beginning from index 0 till the selected curve. The output will be empty if the user selects the first provided curve. Selection of the last curve in the list will result in an output with n-1 curves.<br> +(2) <i>outCurveData</i> - the curve that has been selected by the user.<br> +(3) <i>outCurveList2</i> - the list of curves from the input CurveList beginning after the selected curve till the end. The output will be empty if the user selects the last provided curve. Selection of the first curve in the list will result in an output with n-1 curves.</blockquote> + + + +<h3> +<a name="Parameters"></a>Parameters</h3> + + +<blockquote> - </blockquote> + + + +<h3> +<a name="EventInteract"></a>Events & Interaction</h3> + + + +<blockquote> - </blockquote> + + + +<h3> +<a name="Example"></a>Example</h3> + + + +<blockquote> - </blockquote> + + + +<h3> +<a name="Tips&Tricks"></a>Tips & Tricks</h3> + + + +<blockquote> - </blockquote> + + + +<h3> +<a name="KnownBugs"></a>Known Bugs</h3> + + + +<blockquote> - </blockquote> + + + +</body> +</html> Added: trunk/Community/General/Modules/ML/UMDsplitCurveList/networks/UMDsplitCurveListExample.mlab =================================================================== --- trunk/Community/General/Modules/ML/UMDsplitCurveList/networks/UMDsplitCurveListExample.mlab (rev 0) +++ trunk/Community/General/Modules/ML/UMDsplitCurveList/networks/UMDsplitCurveListExample.mlab 2009-10-01 09:08:50 UTC (rev 207) @@ -0,0 +1,938 @@ +// MDL v1 utf8 +network { + watchlist = "" +} +module UMDsplitCurveList { + internal { + frame = "-187 -67 136 56" + moduleGroupName = "" + windows { + window _default { + geometry = "118 141 500 31" + sizeHint = "500 31" + wasOpen = yes + wasActive = no + } + } + } + fields { + instanceName = UMDsplitCurveList + AvailableCurvesStr = "1: Face Area,2: Face Area" + AvailableCurves = "2: Face Area" + } +} +module LocalImage { + internal { + frame = "-223 429 96 56" + moduleGroupName = "" + } + fields { + instanceName = LocalImage + name = $(DemoDataPath)/Bone.tiff + trueName = "C:/Program Files/MeVisLab2.0VC9/Packages/MeVisLab/Resources/DemoData/Bone.tiff" + autoLoad = TRUE + status = "File open" + } + internalFields = "" +} +module WEMIsoSurface { + internal { + frame = "-235 285 120 56" + moduleGroupName = "" + windows { + window _default { + geometry = "506 550 380 413" + sizeHint = "380 413" + wasOpen = no + wasActive = no + } + } + } + fields { + instanceName = WEMIsoSurface + isProcessing = FALSE + elapsedTime = 0.2809999883 + id = 0 + autoApply = TRUE + autoUpdate = TRUE + autoClear = TRUE + removePreviousWEMs = TRUE + label = "" + description = "" + show = TRUE + editable = TRUE + colorMode = "General " + drawFaces = TRUE + useFaceAmbientColor = TRUE + faceAmbientColor = "0.266667008399963 0.266667008399963 0.266667008399963" + useFaceDiffuseColor = TRUE + faceDiffuseColor = "0.792156994342804 0.792156994342804 0.792156994342804" + useFaceSpecularColor = TRUE + faceSpecularColor = "0.0666669979691505 0.0666669979691505 0.0666669979691505" + faceAlphaValue = 1 + faceShininessValue = 1 + drawFaceNormals = FALSE + faceNormalsColor = "1 1 1" + faceNormalsScale = 1 + drawEdges = FALSE + edgeColor = "0 0 0" + usePolygonOffset = FALSE + lineWidth = 1 + useEdgeColoringMode = FALSE + drawNodes = FALSE + nodeColor = "1 1 1" + drawNodeNormals = FALSE + nodeNormalsColor = "1 1 1" + nodeNormalsScale = 1 + pointSize = 1 + nodeRenderingMode = Normal + drawBoundingBoxes = FALSE + boundingBoxMode = "Axis Aligned" + boundingBoxColor = "1 1 1" + isoMinValue = 1200 + isoMaxValue = 2000 + useMinValue = FALSE + useMaxValue = TRUE + cellExtend = "1 1 1" + useWorldCoords = TRUE + useInterpolation = TRUE + useQuadrification = FALSE + useFaceValueList = FALSE + useValenceThreeRemoval = TRUE + useZeroLengthEdgeRemoval = TRUE + selectedTab = 0 + } +} +module WEMInfo { + internal { + frame = "-259 125 88 56" + moduleGroupName = "" + windows { + window _default { + geometry = "45 554 464 326" + sizeHint = "464 326" + wasOpen = no + wasActive = no + } + window _automatic { + geometry = "1958 306 307 440" + sizeHint = "307 440" + wasOpen = no + wasActive = no + } + window _scriptconsole { + geometry = "1155 445 256 192" + sizeHint = "256 192" + wasOpen = no + wasActive = no + } + } + } + fields { + instanceName = WEMInfo + isProcessing = FALSE + elapsedTime = 0.07800000161 + autoApply = TRUE + autoUpdate = TRUE + autoClear = TRUE + listenToFinishingNotifications = TRUE + listenToRepaintNotifications = TRUE + listenToSelectionChangedNotifications = TRUE + WEMs = "2@" + selectedWEMs = "" + informationFieldsValid = TRUE + numNodes = 13333 + numEdges = 40005 + numFaces = 26670 + uniqueId = 2 + patchType = Triangles + hasEdges = TRUE + surfaceArea = 9452.926758 + surfaceVolume = 11593.98047 + label = "" + description = "" + show = TRUE + editable = TRUE + colorMode = "General " + drawFaces = TRUE + useFaceAmbientColor = TRUE + faceAmbientColor = "0.266667008399963 0.266667008399963 0.266667008399963" + useFaceDiffuseColor = TRUE + faceDiffuseColor = "0.792156994342804 0.792156994342804 0.792156994342804" + useFaceSpecularColor = TRUE + faceSpecularColor = "0.0666669979691505 0.0666669979691505 0.0666669979691505" + faceAlphaValue = 1 + faceShininessValue = 1 + drawFaceNormals = FALSE + faceNormalsColor = "1 1 1" + faceNormalsScale = 1 + drawEdges = FALSE + edgeColor = "0 0 0" + usePolygonOffset = FALSE + lineWidth = 1 + useEdgeColoringMode = FALSE + drawNodes = FALSE + nodeColor = "1 1 1" + drawNodeNormals = FALSE + nodeNormalsColor = "1 1 1" + nodeNormalsScale = 1 + pointSize = 1 + nodeRenderingMode = Normal + drawBoundingBox = FALSE + boundingBoxMode = "Axis Aligned" + boundingBoxColor = "1 1 1" + center = "32 32.49152374267578 12.5" + minimum = "0 0.983045220375061 0" + maximum = "64 64 25" + size = "64 63.01695477962494 25" + radius = 46.61581421 + mainAxisCenter = "37.00667572021484 31.91140174865723 11.19961833953857" + xMainAxis = "0.8188340067863464 0.5700684189796448 -0.06732727587223053" + yMainAxis = "-0.5646404027938843 0.8210079073905945 0.08442250639200211" + zMainAxis = "0.1034028306603432 -0.03111230954527855 0.994152843952179" + xExt = 76.54521942 + yExt = 77.21954346 + zExt = 29.9910202 + primitiveValueLists = "LUT,Edge Length,Face Area,Face Quality,Node Curvature,Node Valence" + selectedPrimitiveValueList = "Face Area" + primitiveValueListValid = TRUE + minPrimitiveValueList = 0 + maxPrimitiveValueList = 1.142393827438354 + meanPrimitiveValueList = 0.35443971761418 + primitiveValueListUnits = mm2 + edgeLengthUnits = mm + faceAreaUnits = mm2 + curveScaleFactor = 1 + selectedTab = 2 + } +} +module Diagram2D { + internal { + frame = "-191 -203 96 56" + moduleGroupName = "" + windows { + window _default { + geometry = "735 382 483 554" + sizeHint = "483 554" + wasOpen = no + wasActive = no + } + } + } + fields { + instanceName = Diagram2D + minX = 0 + maxX = 13 + autoRangeX = TRUE + minY = 0 + maxY = 47.28749847 + autoRangeY = TRUE + axisColor = "1 1 1" + axisRotation = LeftBottom + drawDiagramTitle = TRUE + diagramTitleString = "Face Area" + borderH = 26 + autoBorderH = TRUE + borderV = 40 + autoBorderV = TRUE + drawAxisX = TRUE + drawTicksX = TRUE + drawLabelsX = TRUE + drawAxisTitleX = FALSE + axisTitleStringX = "X [dn] vc" + drawAxisY = TRUE + drawTicksY = TRUE + drawLabelsY = TRUE + drawAxisTitleY = FALSE + axisTitleStringY = "Y [dn]" + curveColor = "1 1 1" + lineStyle = Solid + markerType = None + markerSize = 10 + areaOpacity = 0.5 + lineWidth = 1 + antiAlias = FALSE + button1 = IGNORED + button2 = IGNORED + button3 = IGNORED + shift = IGNORED + ctrl = IGNORED + alt = IGNORED + mousePosX = -0.9825582504 + mousePosY = 53.12361526 + mousePosValid = TRUE + curveSelection = Diagram + selectionTolerance = 5 + selectedCurve = -1 + selectedSeries = -1 + selectedSeriesGlobal = -1 + selectedPoint = -1 + maskValid = TRUE + } +} +module SoRenderArea { + internal { + frame = "-199 -299 112 56" + moduleGroupName = "" + windows { + window _viewer { + geometry = "675 102 400 400" + sizeHint = "400 400" + wasOpen = yes + wasActive = no + } + } + } + fields { + instanceName = SoRenderArea + renderCaching = AUTO + boundingBoxCaching = AUTO + renderCulling = AUTO + pickCulling = AUTO + border = FALSE + background = "0 0 0" + transparency = BLEND + antialiasing = FALSE + antialiasingNumPasses = 1 + grabKeyFocus = TRUE + snapshotFormat = SNAPSHOT_RGB + outputAviFile = "" + autoRedrawWhenRecording = TRUE + frameRate = 7 + frameRateAvi = 15 + status = ready + outputSnapshotFile = none + outputSnapshotFileWritten = none + autoIncreaseFile = TRUE + autoUpdateML = FALSE + showSnapshotWithShell = FALSE + snapCount = 0 + } +} +module WEMInfo { + internal { + frame = "-147 125 88 56" + moduleGroupName = "" + windows { + window _default { + geometry = "535 590 464 326" + sizeHint = "464 326" + wasOpen = no + wasActive = no + } + window _automatic { + geometry = "1729 290 307 440" + sizeHint = "307 440" + wasOpen = no + wasActive = no + } + } + } + fields { + instanceName = WEMInfo1 + isProcessing = FALSE + elapsedTime = 0.03200000152 + autoApply = TRUE + autoUpdate = TRUE + autoClear = TRUE + listenToFinishingNotifications = TRUE + listenToRepaintNotifications = TRUE + listenToSelectionChangedNotifications = TRUE + WEMs = "4@" + selectedWEMs = "" + informationFieldsValid = TRUE + numNodes = 3980 + numEdges = 12000 + numFaces = 8000 + uniqueId = 4 + patchType = Triangles + hasEdges = TRUE + surfaceArea = 9087.744141 + surfaceVolume = 11418.16016 + label = "" + description = "" + show = TRUE + editable = TRUE + colorMode = "General " + drawFaces = TRUE + useFaceAmbientColor = TRUE + faceAmbientColor = "0.266667008399963 0.266667008399963 0.266667008399963" + useFaceDiffuseColor = TRUE + faceDiffuseColor = "0.792156994342804 0.792156994342804 0.792156994342804" + useFaceSpecularColor = TRUE + faceSpecularColor = "0.0666669979691505 0.0666669979691505 0.0666669979691505" + faceAlphaValue = 1 + faceShininessValue = 1 + drawFaceNormals = FALSE + faceNormalsColor = "1 1 1" + faceNormalsScale = 1 + drawEdges = FALSE + edgeColor = "0 0 0" + usePolygonOffset = FALSE + lineWidth = 1 + useEdgeColoringMode = FALSE + drawNodes = FALSE + nodeColor = "1 1 1" + drawNodeNormals = FALSE + nodeNormalsColor = "1 1 1" + nodeNormalsScale = 1 + pointSize = 1 + nodeRenderingMode = Normal + drawBoundingBox = FALSE + boundingBoxMode = "Axis Aligned" + boundingBoxColor = "1 1 1" + center = "32.18994140625 32.51465225219727 12.5" + minimum = "0.3798865675926208 1.029304265975952 0" + maximum = "64 64 25" + size = "63.62011343240738 62.97069573402405 25" + radius = 46.46995926 + mainAxisCenter = "36.68818664550781 31.71071624755859 11.26501941680908" + xMainAxis = "0.8260845541954041 0.5626350045204163 -0.03203367441892624" + yMainAxis = "-0.5583527684211731 0.8248476982116699 0.088703952729702" + zMainAxis = "0.07633084803819656 -0.05539087951183319 0.9955427646636963" + xExt = 76.63578033 + yExt = 76.85345459 + zExt = 28.82315826 + primitiveValueLists = "LUT,Quadric Error,Edge Length,Face Area,Face Quality,Node Curvature,Node Valence" + selectedPrimitiveValueList = "Face Area" + primitiveValueListValid = TRUE + minPrimitiveValueList = 0 + maxPrimitiveValueList = 12.19644355773926 + meanPrimitiveValueList = 1.135967058496957 + primitiveValueListUnits = mm2 + edgeLengthUnits = mm + faceAreaUnits = mm2 + curveScaleFactor = 1 + selectedTab = 2 + } +} +module ConcatenateCurves { + internal { + frame = "-215 33 144 64" + moduleGroupName = "" + windows { + window _default { + geometry = "1183 466 138 104" + sizeHint = "138 104" + wasOpen = no + wasActive = no + } + } + } + fields { + instanceName = CatCurves + enable1 = TRUE + enable2 = TRUE + enable3 = TRUE + enable4 = TRUE + } +} +module StylePalette { + internal { + frame = "-311 37 96 56" + moduleGroupName = "" + windows { + window _default { + geometry = "1399 317 629 488" + sizeHint = "629 488" + wasOpen = no + wasActive = no + } + } + } + fields { + instanceName = StylePalette + color1 = "1 1 0" + color2 = "1 0 0" + color3 = "0 0 1" + color4 = "0 1 0" + color5 = "1 0.5 0" + color6 = "1 0 1" + color7 = "0 1 1" + color8 = "0.5 1 0.5" + color9 = "1 0 0.5" + color10 = "0.5 1 0" + color11 = "0.5 0 1" + color12 = "0 1 0.5" + lineStyle1 = Solid + lineStyle2 = Solid + lineStyle3 = Solid + lineStyle4 = Solid + lineStyle5 = Solid + lineStyle6 = Solid + lineStyle7 = Solid + lineStyle8 = Solid + lineStyle9 = Solid + lineStyle10 = Solid + lineStyle11 = Solid + lineStyle12 = Solid + lineWidth1 = 1 + lineWidth2 = 1 + lineWidth3 = 1 + lineWidth4 = 1 + lineWidth5 = 1 + lineWidth6 = 1 + lineWidth7 = 1 + lineWidth8 = 1 + lineWidth9 = 1 + lineWidth10 = 1 + lineWidth11 = 1 + lineWidth12 = 1 + markerType1 = None + markerType2 = None + markerType3 = None + markerType4 = None + markerType5 = None + markerType6 = None + markerType7 = None + markerType8 = None + markerType9 = None + markerType10 = None + markerType11 = None + markerType12 = None + markerSize1 = 4 + markerSize2 = 4 + markerSize3 = 4 + markerSize4 = 4 + markerSize5 = 4 + markerSize6 = 4 + markerSize7 = 4 + markerSize8 = 4 + markerSize9 = 4 + markerSize10 = 4 + markerSize11 = 4 + markerSize12 = 4 + antiAlias1 = FALSE + antiAlias2 = FALSE + antiAlias3 = FALSE + antiAlias4 = FALSE + antiAlias5 = FALSE + antiAlias6 = FALSE + antiAlias7 = FALSE + antiAlias8 = FALSE + antiAlias9 = FALSE + antiAlias10 = FALSE + antiAlias11 = FALSE + antiAlias12 = FALSE + name1 = "" + name2 = "" + name3 = "" + name4 = "" + name5 = "" + name6 = "" + name7 = "" + name8 = "" + name9 = "" + name10 = "" + name11 = "" + name12 = "" + currentStyle = 0 + currentColor = "1 1 1" + currentLineStyle = None + currentLineWidth = 1 + currentMarkerType = None + currentMarkerSize = 4 + currentAntiAlias = FALSE + currentName = "" + reservedEntries = 0 + } +} +module SubImage { + internal { + frame = "-219 353 88 64" + moduleGroupName = "" + windows { + window _default { + geometry = "48 88 431 319" + sizeHint = "431 319" + wasOpen = no + wasActive = no + } + } + } + fields { + instanceName = Subimage + boxInput = "0 0 0 0 0 0 -1 -1 -1 -1 -1 -1" + autoApplyBox = FALSE + x = 0 + sx = 64 + modifyX = FALSE + y = 0 + sy = 64 + modifyY = FALSE + z = 0 + sz = 25 + modifyZ = TRUE + c = 0 + sc = 1 + modifyC = FALSE + t = 0 + st = 1 + modifyT = FALSE + u = 0 + su = 1 + modifyU = FALSE + fillValue = 0 + mode = VoxelStartSize + autoApply = TRUE + } +} +module Comment { + internal { + frame = "-27 253 88 56" + moduleGroupName = "" + windows { + window _default { + geometry = "47 93 379 408" + sizeHint = "256 209" + wasOpen = no + wasActive = no + } + } + } + fields { + instanceName = Comment + comment = "In this example a WEM is reduced with WEMReducePolygons and information on both the original mesh and the reduced mesh is put against each other. + +On the general panel the number of primitives can be seen, as well as some administrative information. + +The statistics panel shows minimum, maximum and mean values for different statistical modes. Change the primitive value to see these values. + +In this example all primitive values have a curve which displays the coverage of set statistic across the WEM. + +Notice the significant increase in 'Edge Length', 'Face Area', 'Face Quality' and 'Node Curvature' due to the mesh reduction by WEMReducePolygons." + } + internalFields = "" +} +module WEMReducePolygons { + internal { + frame = "-163 205 152 56" + moduleGroupName = "" + windows { + window _default { + geometry = "220 114 341 413" + sizeHint = "341 413" + wasOpen = no + wasActive = no + } + } + } + fields { + instanceName = WEMReducePolygons + isProcessing = FALSE + elapsedTime = 1.281000018 + id = 0 + autoApply = TRUE + autoUpdate = TRUE + autoClear = FALSE + removePreviousWEMs = TRUE + label = "" + description = "" + show = TRUE + editable = TRUE + colorMode = "General " + drawFaces = TRUE + useFaceAmbientColor = TRUE + faceAmbientColor = "0.266667008399963 0.266667008399963 0.266667008399963" + useFaceDiffuseColor = TRUE + faceDiffuseColor = "0.792156994342804 0.792156994342804 0.792156994342804" + useFaceSpecularColor = TRUE + faceSpecularColor = "0.0666669979691505 0.0666669979691505 0.0666669979691505" + faceAlphaValue = 1 + faceShininessValue = 1 + drawFaceNormals = FALSE + faceNormalsColor = "1 1 1" + faceNormalsScale = 1 + drawEdges = FALSE + edgeColor = "0 0 0" + usePolygonOffset = FALSE + lineWidth = 1 + useEdgeColoringMode = FALSE + drawNodes = FALSE + nodeColor = "1 1 1" + drawNodeNormals = FALSE + nodeNormalsColor = "1 1 1" + nodeNormalsScale = 1 + pointSize = 1 + nodeRenderingMode = Normal + drawBoundingBoxes = FALSE + boundingBoxMode = "Axis Aligned" + boundingBoxColor = "1 1 1" + copyInputWEMs = TRUE + listenToFinishNotifications = TRUE + forwardRepaintNotifications = TRUE + forwardSelectionNotifications = TRUE + triangulationMode = Strip + modifyAttributes = FALSE + targetReduction = 70 + smooth = TRUE + numEdgeCollapses = 9101 + reduction = 70 + useExpertMode = FALSE + vertexPlacementMode = Middle + areaWeightedQuadrics = TRUE + valenceWeightedQuadrics = TRUE + edgeWeightedQuadrics = TRUE + selectedTab = 0 + outputTabSelected = TRUE + } +} +module SoWEMRenderer { + internal { + frame = "9 -155 128 56" + moduleGroupName = "" + windows { + window _default { + geometry = "1162 495 337 404" + sizeHint = "337 404" + wasOpen = no + wasActive = no + } + } + } + fields { + instanceName = SoWEMRenderer + renderCaching = AUTO + boundingBoxCaching = AUTO + renderCulling = AUTO + pickCulling = AUTO + autoApply = TRUE + autoUpdate = TRUE + autoClear = TRUE + useHighlightSelected = FALSE + usePolygonOffset = TRUE + useShapeHints = TRUE + allowHits = TRUE + parameterOverwriteMode = OVERWRITE_MODE_ALL + overwriteColorMode = FALSE + overwriteFaceParameters = FALSE + overwriteEdgeParameters = FALSE + overwriteNodeParameters = FALSE + overwriteBoundingBoxParameters = FALSE + colorMode = WEM_COLOR_GENERAL + drawFaces = TRUE + faceDiffuseColor = "0.792156994342804 0.792156994342804 0.792156994342804" + useFaceAmbientColor = TRUE + faceAmbientColor = "0.2666670083999634 0.2666670083999634 0.2666670083999634" + useFaceSpecularColor = TRUE + faceSpecularColor = "0.06666699796915054 0.06666699796915054 0.06666699796915054" + drawEdges = TRUE + edgeColor = "0 0 0" + drawNodes = FALSE + nodeColor = "1 1 1" + drawBoundingBoxes = FALSE + boundingBoxColor = "1 1 1" + drawFaceNormals = FALSE + drawNodeNormals = FALSE + faceNormalColor = "1 1 1" + nodeNormalColor = "1 1 1" + faceNormalScaling = 1 + nodeNormalScaling = 1 + faceAlphaValue = 1 + faceShininessValue = 1 + lineWidth = 1 + pointSize = 1 + useEdgeColoringMode = FALSE + nodeRenderingMode = WEM_NODE_RENDERING_NORMAL + boundingBoxMode = WEM_BOUNDING_BOX_AXIS_ALIGNED + primitiveValueLists = "LUT,Face Area" + selectedPrimitiveValueList = LUT + primitiveValueListValid = TRUE + selectedTab = 0 + } +} +module SoExaminerViewer { + internal { + frame = "45 -307 152 56" + moduleGroupName = "" + windows { + window _viewer { + geometry = "598 535 566 400" + sizeHint = "400 400" + wasOpen = yes + wasActive = no + } + } + } + fields { + instanceName = SoExaminerViewer + renderCaching = AUTO + boundingBoxCaching = AUTO + renderCulling = AUTO + pickCulling = AUTO + border = FALSE + background = "0 0 0" + transparency = BLEND + antialiasing = FALSE + antialiasingNumPasses = 1 + grabKeyFocus = TRUE + snapshotFormat = SNAPSHOT_RGB + outputAviFile = "" + autoRedrawWhenRecording = TRUE + frameRate = 7 + frameRateAvi = 15 + status = ready + outputSnapshotFile = none + outputSnapshotFileWritten = none + autoIncreaseFile = TRUE + autoUpdateML = FALSE + showSnapshotWithShell = FALSE + snapCount = 0 + headlight = TRUE + decoration = TRUE + popupMenuEnabled = FALSE + viewing = TRUE + autoClipping = TRUE + externalCamera = FALSE + drawStyle = VIEW_AS_IS + interactiveDrawStyle = VIEW_LOW_COMPLEXITY + viewAllFlag = FALSE + initialCameraOrientation = CAMERA_KEEP_AS_IS + applyCameraOrientation = CAMERA_KEEP_AS_IS + cameraType = CAMERA_PERSPECTIVE + userSettingOrientation = "0 0 1 0" + automaticViewAll = FALSE + storeCurrentState = TRUE + saveCamera = TRUE + cursor = TRUE + isCameraStored = TRUE + perspective = TRUE + stereoViewing = FALSE + stereoOffset = 3 + height = 0.7853980064 + position = "56.50242614746094 -37.72786712646484 85.03986358642578" + orientation = "0.9552596807479858 0.05349960178136826 -0.2908898293972015 0.7712323665618896" + nearDistance = 68.03115082 + farDistance = 134.368103 + focalDistance = 113.3730011 + forceRedrawOnInteraction = FALSE + button1events = TO_VIEWER + button2events = TO_VIEWER + button3events = TO_VIEWER + keyEvents = TO_VIEWER + animationEnabled = FALSE + feedback = FALSE + feedbackSize = 32 + mouseInteraction = "" + rotationAxis = "0 1 0" + rotationAngle = 360 + rotationSteps = 80 + rotationCurrentStep = 0 + recordRotation = TRUE + } +} +module SoBackground { + internal { + frame = "-31 -227 112 56" + moduleGroupName = "" + } + fields { + instanceName = SoBackground + rotate = TRUE + flip = FALSE + on = TRUE + depthBuffer = TRUE + } +} +module SoWEMRenderer { + internal { + frame = "133 -155 136 56" + moduleGroupName = "" + windows { + window _default { + geometry = "795 427 337 404" + sizeHint = "337 404" + wasOpen = no + wasActive = no + } + } + } + fields { + instanceName = SoWEMRenderer1 + renderCaching = AUTO + boundingBoxCaching = AUTO + renderCulling = AUTO + pickCulling = AUTO + autoApply = TRUE + autoUpdate = TRUE + autoClear = TRUE + useHighlightSelected = FALSE + usePolygonOffset = TRUE + useShapeHints = TRUE + allowHits = TRUE + parameterOverwriteMode = OVERWRITE_MODE_ALL + overwriteColorMode = FALSE + overwriteFaceParameters = FALSE + overwriteEdgeParameters = FALSE + overwriteNodeParameters = FALSE + overwriteBoundingBoxParameters = FALSE + colorMode = WEM_COLOR_GENERAL + drawFaces = TRUE + faceDiffuseColor = "0.792156994342804 0.792156994342804 0.792156994342804" + useFaceAmbientColor = TRUE + faceAmbientColor = "0.2666670083999634 0.2666670083999634 0.2666670083999634" + useFaceSpecularColor = TRUE + faceSpecularColor = "0.06666699796915054 0.06666699796915054 0.06666699796915054" + drawEdges = TRUE + edgeColor = "0 0 0" + drawNodes = FALSE + nodeColor = "1 1 1" + drawBoundingBoxes = FALSE + boundingBoxColor = "1 1 1" + drawFaceNormals = FALSE + drawNodeNormals = FALSE + faceNormalColor = "1 1 1" + nodeNormalColor = "1 1 1" + faceNormalScaling = 1 + nodeNormalScaling = 1 + faceAlphaValue = 1 + faceShininessValue = 1 + lineWidth = 1 + pointSize = 1 + useEdgeColoringMode = FALSE + nodeRenderingMode = WEM_NODE_RENDERING_NORMAL + boundingBoxMode = WEM_BOUNDING_BOX_AXIS_ALIGNED + primitiveValueLists = "LUT,Quadric Error,Face Area" + selectedPrimitiveValueList = LUT + primitiveValueListValid = TRUE + selectedTab = 0 + } +} +module SoTranslation { + internal { + frame = "73 -227 112 56" + moduleGroupName = "" + windows { + window _default { + geometry = "826 554 274 37" + sizeHint = "274 37" + wasOpen = no + wasActive = no + } + } + } + fields { + instanceName = SoTranslation + translation = "66 0 0" + } +} +connections { + UMDsplitCurveList.inCurveList = CatCurves.outCurveList + WEMIsoSurface.input0 = Subimage.output0 + WEMInfo.inWEM = WEMIsoSurface.outWEM + Diagram2D.inStylePalette = StylePalette.outStylePalette + Diagram2D.inCurveList = UMDsplitCurveList.outCurveData + Diagram2D.diagramTitleString = WEMInfo.selectedPrimitiveValueList + SoRenderArea.children = Diagram2D.outNode + WEMInfo1.inWEM = WEMReducePolygons.outWEM + WEMInfo1.selectedWEMs = WEMInfo.selectedWEMs + WEMInfo1.selectedPrimitiveValueList = WEMInfo.selectedPrimitiveValueList + CatCurves.inCurve1 = WEMInfo.outputCurveData + CatCurves.inCurve2 = WEMInfo1.outputCurveData + Subimage.input0 = LocalImage.outImage + WEMReducePolygons.inWEM = WEMIsoSurface.outWEM + SoWEMRenderer.inWEM = WEMIsoSurface.outWEM + SoExaminerViewer.children = "SoBackground.self SoWEMRenderer.self SoTranslation.self SoWEMRenderer1.self" + SoWEMRenderer1.inWEM = WEMReducePolygons.outWEM +} +networkModel = "" Added: trunk/Community/General/Sources/ML/UMDsplitCurveList/UMDsplitCurveList.bat =================================================================== --- trunk/Community/General/Sources/ML/UMDsplitCurveList/UMDsplitCurveList.bat (rev 0) +++ trunk/Community/General/Sources/ML/UMDsplitCurveList/UMDsplitCurveList.bat 2009-10-01 09:08:50 UTC (rev 207) @@ -0,0 +1,3 @@ +"%MLAB_ROOT%\MeVis\Foundation\BuildTools\Scripts\createProject.bat" UMDsplitCurveList + + Added: trunk/Community/General/Sources/ML/UMDsplitCurveList/UMDsplitCurveList.pro =================================================================== --- trunk/Community/General/Sources/ML/UMDsplitCurveList/UMDsplitCurveList.pro (rev 0) +++ trunk/Community/General/Sources/ML/UMDsplitCurveList/UMDsplitCurveList.pro 2009-10-01 09:08:50 UTC (rev 207) @@ -0,0 +1,42 @@ +# ----------------------------------------------------------------------------- +# UMDsplitCurveList project profile +# +# \file UMDsplitCurveList.pro +# \author Tobias M\xF6nch +# \date 2009-08-05 +# ----------------------------------------------------------------------------- + +TEMPLATE = lib + +TARGET = UMDsplitCurveList + +DESTDIR = ../../../lib +DLLDESTDIR = ../../../lib + +# set high warn level (warn 4 on MSCV) +WARN = HIGH + +# add used projects here (see included pri files below for available projects) +CONFIG += dll ML MLBase + +MLAB_PACKAGES += Community_General \ + MeVisLab_Standard + +# make sure that this file is included after CONFIG and MLAB_PACKAGES +include ($(MLAB_MeVis_Foundation)/Configuration/IncludePackages.pri) + +DEFINES += UMDSPLITCURVELIST_EXPORTS + +HEADERS += \ + UMDsplitCurveListInit.h \ + UMDsplitCurveListSystem.h \ + mlUMDsplitCurveList.h + +SOURCES += \ + UMDsplitCurveListInit.cpp \ + mlUMDsplitCurveList.cpp + +# additional files that are NOT compiled +RELATEDFILES += \ + ../../../Modules/ML/UMDsplitCurveList/UMDsplitCurveList.def + Added: trunk/Community/General/Sources/ML/UMDsplitCurveList/UMDsplitCurveList.sh =================================================================== --- trunk/Community/General/Sources/ML/UMDsplitCurveList/UMDsplitCurveList.sh (rev 0) +++ trunk/Community/General/Sources/ML/UMDsplitCurveList/UMDsplitCurveList.sh 2009-10-01 09:08:50 UTC (rev 207) @@ -0,0 +1,35 @@ +#! /bin/bash +#----------------------------------------------------------------------------- +# ----------------------------------------------------------------------- +# +# Copyright (c) 2001-2009, MeVis Medical Solutions AG, Bremen, Germany +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# * Neither the name of MeVis Medical Solutions AG nor the +# names of its contributors may be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY MEVIS MEDICAL SOLUTIONS AG ''AS IS'' AND ANY +# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL MEVIS MEDICAL SOLUTIONS AG BE LIABLE FOR ANY +# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +#----------------------------------------------------------------------------- +if [ "`uname -s`" = "Darwin" && "$MLAB_ROOT" = "" ]; then + echo "Generate Xcode projects by double-clicking the file 'UMDsplitCurveList.pro' in Finder or use the MeVisLabProjectGenerator.app from the command line to customize the project creation." +else + python $MLAB_ROOT/MeVis/Foundation/BuildTools/Scripts/createProject.py UMDsplitCurveList +fi + Added: trunk/Community/General/Sources/ML/UMDsplitCurveList/UMDsplitCurveListInit.cpp =================================================================== --- trunk/Community/General/Sources/ML/UMDsplitCurveList/UMDsplitCurveListInit.cpp (rev 0) +++ trunk/Community/General/Sources/ML/UMDsplitCurveList/UMDsplitCurveListInit.cpp 2009-10-01 09:08:50 UTC (rev 207) @@ -0,0 +1,42 @@ +//---------------------------------------------------------------------------------- +//! Dynamic library and runtime type system initialization. +/*! +// \file UMDsplitCurveListInit.cpp +// \author Tobias M\xF6nch +// \date 2009-08-05 +*/ +//---------------------------------------------------------------------------------- + + +// Local includes +#include "UMDsplitCurveListSystem.h" + +// Include definition of ML_INIT_LIBRARY. +#include "mlLibraryInitMacros.h" + +// Include all module headers ... +#include "mlUMDsplitCurveList.h" + + +ML_START_NAMESPACE + +//---------------------------------------------------------------------------------- +//! Calls init functions of all modules to add their types to the runtime type +//! system of the ML. +//---------------------------------------------------------------------------------- +int UMDsplitCurveListInit () +{ + ML_TRACE_IN("UMDsplitCurveListInit ()") + + UMDsplitCurveList::initClass(); + // Add initClass calls from all other modules here... + + return 1; +} + +ML_END_NAMESPACE + + +//! Calls the init method implemented above during load of shared library. +ML_INIT_LIBRARY(UMDsplitCurveListInit) + Added: trunk/Community/General/Sources/ML/UMDsplitCurveList/UMDsplitCurveListInit.h =================================================================== --- trunk/Community/General/Sources/ML/UMDsplitCurveList/UMDsplitCurveListInit.h (rev 0) +++ trunk/Community/General/Sources/ML/UMDsplitCurveList/UMDsplitCurveListInit.h 2009-10-01 09:08:50 UTC (rev 207) @@ -0,0 +1,25 @@ +//---------------------------------------------------------------------------------- +//! Dynamic library and runtime type system initialization. +/*! +// \file UMDsplitCurveListInit.h +// \author Tobias M\xF6nch +// \date 2009-08-05 +*/ +//---------------------------------------------------------------------------------- + + +#ifndef __UMDsplitCurveListInit_H +#define __UMDsplitCurveListInit_H + + +ML_START_NAMESPACE + +//! Calls init functions of all modules to add their types to the runtime type +//! system of the ML. +int UMDsplitCurveListInit (); + +ML_END_NAMESPACE + +#endif // __UMDsplitCurveListInit_H + + Added: trunk/Community/General/Sources/ML/UMDsplitCurveList/UMDsplitCurveListSystem.h =================================================================== --- trunk/Community/General/Sources/ML/UMDsplitCurveList/UMDsplitCurveListSystem.h (rev 0) +++ trunk/Community/General/Sources/ML/UMDsplitCurveList/UMDsplitCurveListSystem.h 2009-10-01 09:08:50 UTC (rev 207) @@ -0,0 +1,33 @@ +//---------------------------------------------------------------------------------- +//! Project global and OS specific declarations. +/*! +// \file UMDsplitCurveListSystem.h +// \author Tobias M\xF6nch +// \date 2009-08-05 +*/ +//---------------------------------------------------------------------------------- + + +#ifndef __UMDsplitCurveListSystem_H +#define __UMDsplitCurveListSystem_H + + +// DLL export macro definition +#ifdef WIN32 +#ifdef UMDSPLITCURVELIST_EXPORTS +// Use the UMDSPLITCURVELIST_EXPORT macro to export classes and functions +#define UMDSPLITCURVELIST_EXPORT __declspec(dllexport) +#else +// If included by external modules, exported symbols are declared as import symbols +#define UMDSPLITCURVELIST_EXPORT __declspec(dllimport) +#endif + +#else +// No export declarations are necessary for non-Windows systems +#define UMDSPLITCURVELIST_EXPORT +#endif + + +#endif // __UMDsplitCurveListSystem_H + + Added: trunk/Community/General/Sources/ML/UMDsplitCurveList/mlUMDsplitCurveList.cpp =================================================================== --- trunk/Community/General/Sources/ML/UMDsplitCurveList/mlUMDsplitCurveList.cpp (rev 0) +++ trunk/Community/General/Sources/ML/UMDsplitCurveList/mlUMDsplitCurveList.cpp 2009-10-01 09:08:50 UTC (rev 207) @@ -0,0 +1,167 @@ +//---------------------------------------------------------------------------------- +//! The ML module class UMDsplitCurveList. +/*! +// \file mlUMDsplitCurveList.cpp +// \author Tobias M\xF6nch +// \date 2009-08-05 +// +// Extracts single curves and several curves from a CureList object. +*/ +//---------------------------------------------------------------------------------- + +// Local includes +#include "mlUMDsplitCurveList.h" + +ML_START_NAMESPACE + +using namespace std; + +std::string +asString( double d, int precision = 6 ) +{ +std::ostringstream s ; +s.precision( precision ) ; +s << d ; +return s.str() ; +} + + +//! Implements code for the runtime type system of the ML +ML_BASEOP_CLASS_SOURCE(UMDsplitCurveList, BaseOp); + +//---------------------------------------------------------------------------------- +//! Constructor +//---------------------------------------------------------------------------------- +UMDsplitCurveList::UMDsplitCurveList () + : BaseOp(0, 0) +{ + ML_TRACE_IN("UMDsplitCurveList::UMDsplitCurveList ()"); + + // Suppress calls of handleNotification on field changes to + // avoid side effects during initialization phase. + handleNotificationOff(); + + FieldContainer *fc = getFieldContainer(); + + // add input field + _inputCurveListFld = fc->addBase("inCurveList"); + + // output fields + (_curveList1Fld = fc->addBase("outCurveList1"))->setBaseValue(&_curveList1); + (_curveDataFld = fc->addBase("outCurveData"))->setBaseValue(&_curveData); + (_curveList2Fld = fc->addBase("outCurveList2"))->setBaseValue(&_curveList2); + + // GUI element(s) + _availableCurvesStrFld = fc->addString("AvailableCurvesStr"); + _availableCurvesFld = fc->addString("AvailableCurves"); + _availableCurvesFld->setStringValue(""); + + + this->activateAttachments(); + + // Reactivate calls of handleNotification on field changes. + handleNotificationOn(); +} + +//---------------------------------------------------------------------------------- +//! Handle field changes of the field field. +//---------------------------------------------------------------------------------- +void UMDsplitCurveList::handleNotification (Field *field) +{ + ML_TRACE_IN("UMDsplitCurveList::handleNotification ()"); + // Handle changes of module parameters and connectors here. + + // some status variable + bool inputOK = false; + + // check if input is available + if (_inputCurveListFld->getBaseValue() != NULL) + { + // initially clear the list of curves + _availableCurvesStrFld->setStringValue(""); + _availableCurves.clear(); + _availableCurvesVec.clear(); + + // if the input is of type "CurveList" .... + if (strcmpi(_inputCurveListFld->getBaseValue()->getTypeIdName(),"CurveList")==0) + { + // set status + inputOK = true; + + // get the data + _inputCurveList = (ml::CurveList *)_inputCurveListFld->getBaseValue(); + + // run over the curves + for (int i=0; i<_inputCurveList->getNumCurves(); i++) + { + // add a "," as separator + if (i!=0) _availableCurves.append(","); + + // append the strings to both: the output string and a similar string-vector + //_availableCurves.append(asString(i+1,0)); + //_availableCurves.append(": "); + _availableCurves.append(asString(i+1,0) + ": " + _inputCurveList->getCurveList()[i]->getTitle().c_str()); + + _availableCurvesVec.push_back(asString(i+1,0) + ": " + _inputCurveList->getCurveList()[i]->getTitle().c_str()); + } + // assign the string to the field + _availableCurvesStrFld->setStringValue(_availableCurves); + } + } + // clear the list + else _availableCurvesStrFld->setStringValue(""); + + // check again if input is available + if ((_inputCurveListFld->getBaseValue() != NULL) && (_inputCurveList->getNumCurves() > 0) && inputOK) + { + // clear the output curveLists and the curveData + _curveList1.getCurveList().clear(); + _curveList2.getCurveList().clear(); + _curveData.clear(); + + // status and index variables + int selectionIdx=0; + bool found = false; + + // run over the available curves ... + for (int i=0; i<_availableCurvesVec.size(); i++) + { + // check which curve has been selected + if (_availableCurvesVec[i].compare(_availableCurvesFld->getStringValue()) == 0) + { + // remember its index and set status to true + selectionIdx = i; + found = true; + } + // as long as the selected curve was not found in the list, push all curves into curveList1 + if (!found) _curveList1.getCurveList().push_back(_inputCurveList->getCurveList()[i]); + + // after the selected curve has been found, push all curves into curveList2 + else if (found && (i>selectionIdx)) _curveList2.getCurveList().push_back(_inputCurveList->getCurveList()[i]); + } + // assign the selected curve as single output + _curveData = *_inputCurveList->getCurveList()[selectionIdx]; + + // do the output to the fields + _curveList1Fld->setBaseValue(&_curveList1); + _curveList2Fld->setBaseValue(&_curveList2); + _curveDataFld->setBaseValue(&_curveData); + } +} + +//---------------------------------------------------------------------------------- +//! Update internal module state after load or clone and enable notification handling again. +//---------------------------------------------------------------------------------- +void UMDsplitCurveList::activateAttachments () +{ + ML_TRACE_IN("UMDsplitCurveList::activateAttachments ()"); + + // Update members to new field state here. + // Call super class functionality to enable notification handling again. + BaseOp::activateAttachments (); +} + + + +ML_END_NAMESPACE + Added: trunk/Community/General/Sources/ML/UMDsplitCurveList/mlUMDsplitCurveList.h =================================================================== --- trunk/Community/General/Sources/ML/UMDsplitCurveList/mlUMDsplitCurveList.h (rev 0) +++ trunk/Community/General/Sources/ML/UMDsplitCurveList/mlUMDsplitCurveList.h 2009-10-01 09:08:50 UTC (rev 207) @@ -0,0 +1,74 @@ +//---------------------------------------------------------------------------------- +//! The ML module class UMDsplitCurveList. +/*! +// \file mlUMDsplitCurveList.h +// \author Tobias M\xF6nch +// \date 2009-08-05 +// +// Extracts single curves and several curves from a CureList object. +*/ +//---------------------------------------------------------------------------------- + + +#ifndef __mlUMDsplitCurveList_H +#define __mlUMDsplitCurveList_H + + +// Local includes +#include "UMDsplitCurveListSystem.h" + +// ML includes +#include "mlOperatorIncludes.h" +#include "mlCurveData.h" +#include "mlCurveList.h" + +ML_START_NAMESPACE + + +//! Extracts single curves and several curves from a CureList object. +class UMDSPLITCURVELIST_EXPORT UMDsplitCurveList : public BaseOp +{ +public: + + //! Constructor. + UMDsplitCurveList (); + + //! Handle field changes of the field field. + virtual void handleNotification (Field *field); + + //! Update internal module state after load or clone and enable notification handling again. + virtual void activateAttachments (); + + //@} + +private: + + // input and output fields + BaseField *_inputCurveListFld; + BaseField *_curveList1Fld; + BaseField *_curveList2Fld; + BaseField *_curveDataFld; + + // the internal data + CurveData _curveData; + CurveList _curveList1; + CurveList _curveList2; + CurveList *_inputCurveList; + + // GUI element(s) + StringField *_availableCurvesFld; + StringField *_availableCurvesStrFld; + + // for handling the curve names + std::vector<std::string> _availableCurvesVec; + std::string _availableCurves; + + //! Implements interface for the runtime type system of the ML. + ML_BASEOP_CLASS_HEADER(UMDsplitCurveList) +}; + + +ML_END_NAMESPACE + +#endif // __mlUMDsplitCurveList_H + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bar...@us...> - 2009-10-01 09:01:54
|
Revision: 206 http://mevislabmodules.svn.sourceforge.net/mevislabmodules/?rev=206&view=rev Author: bartdedobbelaer Date: 2009-10-01 09:01:44 +0000 (Thu, 01 Oct 2009) Log Message: ----------- - Allow multiple pre- and post commands (delimited by ;) Modified Paths: -------------- trunk/Community/General/Modules/Macros/WinSCP/WinSCP.py Modified: trunk/Community/General/Modules/Macros/WinSCP/WinSCP.py =================================================================== --- trunk/Community/General/Modules/Macros/WinSCP/WinSCP.py 2009-09-04 14:30:33 UTC (rev 205) +++ trunk/Community/General/Modules/Macros/WinSCP/WinSCP.py 2009-10-01 09:01:44 UTC (rev 206) @@ -42,13 +42,15 @@ winsources.append(MLABFileManager.nativePath(source)) script = _getScript() - preCommand = ctx.field("preCommand").stringValue() - if preCommand: - script += preCommand + "\n" + commands = ctx.field("preCommand").stringValue().split(";") + for command in commands: + if command: + script += command + "\n" script += "put \"" + "\" \"".join(winsources) + "\" \"" + target + "\"\n" - postCommand = ctx.field("postCommand").stringValue() - if postCommand: - script += postCommand + "\n" + commands = ctx.field("postCommand").stringValue().split(";") + for command in commands: + if command: + script += command + "\n" script += "close\nexit\n" _executeScript(script) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <awa...@us...> - 2009-09-04 14:30:43
|
Revision: 205 http://mevislabmodules.svn.sourceforge.net/mevislabmodules/?rev=205&view=rev Author: awakeideas Date: 2009-09-04 14:30:33 +0000 (Fri, 04 Sep 2009) Log Message: ----------- updated to current scripting dictionary Modified Paths: -------------- trunk/Community/General/Sources/ML/MLOsiriXImporter/MeVisLabHub/MeVisLab.h Modified: trunk/Community/General/Sources/ML/MLOsiriXImporter/MeVisLabHub/MeVisLab.h =================================================================== --- trunk/Community/General/Sources/ML/MLOsiriXImporter/MeVisLabHub/MeVisLab.h 2009-09-02 14:51:06 UTC (rev 204) +++ trunk/Community/General/Sources/ML/MLOsiriXImporter/MeVisLabHub/MeVisLab.h 2009-09-04 14:30:33 UTC (rev 205) @@ -20,6 +20,7 @@ - (SBElementArray *) documents; @property (copy, readonly) NSString *name; // The name of the application. +@property (readonly) BOOL frontmost; // Is this the frontmost (active) application? @property (copy, readonly) NSString *version; // The version number of the application. - (void) open:(NSArray *)x; // Open a document. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |