vmtk reading error vti files

159 views
Skip to first unread message

Jameson Merkow

unread,
Sep 18, 2013, 2:25:09 PM9/18/13
to vmtk-...@googlegroups.com
Hello,

I am just getting started on vmtk.  I installed it on windows from the dmg (for lion).  I am currently running mountain lion OS X (10.8.4).  I also have SimpleITK and VTK6 installed, and wrapped for python.

Ok on to my question.  I was trying to do a simple read, and then view

jmerkow$ vmtkimagereader -ifile sample_data-mm.vti --pipe vmtkimageviewer

objc[26870]: Class vtkCocoaServer is implemented in both /usr/local/lib/libvtkRenderingOpenGL-6.0.1.dylib and /Applications/vmtk.app/Contents/Resources/lib/vtk-5.8/libvtkRendering.5.8.dylib. One of the two will be used. Which one is undefined.
objc[26870]: Class vtkCocoaTimer is implemented in both /usr/local/lib/libvtkRenderingOpenGL-6.0.1.dylib and /Applications/vmtk.app/Contents/Resources/lib/vtk-5.8/libvtkRendering.5.8.dylib. One of the two will be used. Which one is undefined.
objc[26870]: Class vtkCocoaGLView is implemented in both /usr/local/lib/libvtkRenderingOpenGL-6.0.1.dylib and /Applications/vmtk.app/Contents/Resources/lib/vtk-5.8/libvtkRendering.5.8.dylib. One of the two will be used. Which one is undefined.
Creating vmtkImageReader instance.
Automatic piping vmtkimagereader
Parsing options vmtkimagereader
    InputFileName = sample_data-mm.vti
Explicit piping vmtkimagereader
Input vmtkimagereader members:
    Id = 0
    Disabled = 0
    Format =
    GuessFormat = 1
    UseITKIO = 1
    Image = 0
    InputFileName = sample_data-mm.vti
    InputFilePrefix =
    InputFilePattern =
    InputDirectoryName =
    DataExtent = [-1, -1, -1, -1, -1, -1]
    HeaderSize = 0
    DataSpacing = [1.0, 1.0, 1.0]
    DataOrigin = [0.0, 0.0, 0.0]
    DesiredOrientation = native
    DataByteOrder = littleendian
    DataScalarType = float
    FileDimensionality = 3
    Flip = [0, 0, 0]
    AutoOrientDICOMImage = 1
    ImageOutputFileName =
Executing vmtkimagereader ...
Reading VTK XML image file.
Spacing 0.781250 2.000000 0.781250
Origin -203.609000 -50.200000 -229.109000
Dimensions 512 64 512
Error from pype: GetSource


It seems to be reading, it has the correct spacing origin etc, but i get a pype error.

Any thoughts? I couldn't find anything when searching the mailing list that addressed this.

Jameson Merkow

unread,
Sep 19, 2013, 8:10:33 PM9/19/13
to vmtk-...@googlegroups.com
So I tried running the code exactly as in the tutorial (not trying to get fancy with vti).  I also removed my VTK6 installation to try to get this to work.

Here is the code:
vmtk vmtkimagereader -f dicom -d ./pcmri/left_iliac --pipe vmtkimageviewer


Traceback (most recent call last):
  File "/Applications/vmtk.app/Contents/Resources/bin/vmtk", line 60, in <module>
    pipe.Execute()
  File "/Applications/vmtk.app/Contents/Resources/lib/vmtk/vmtk/pype.py", line 244, in Execute
    self.PrintError('No module named ' + moduleName + '\n' + e)
TypeError: cannot concatenate 'str' and 'exceptions.ImportError' objects

Luca Antiga

unread,
Sep 21, 2013, 8:35:39 AM9/21/13
to vmtk-...@googlegroups.com
Hi Jameson,
 the error in your first message was due to the fact that VTK 6 dynamic libraries were being loaded instead of or in addition to the ones that come with vmtk. Now you removed VTK 6, so that part is solved (you could have preserved both by setting environment variables carefully).

Now apparently either Python modules for the scripts or libraries can't be found. Try following the instructions at http://www.vmtk.org/Main/Installation/#OSX all the way to the end of the Mac OSX section. Please let me know if the manual imports in the Python console succeed.

Best,

Luca

Jameson Merkow

unread,
Sep 23, 2013, 1:58:36 PM9/23/13
to vmtk-...@googlegroups.com

Can you elaborate on setting environment variables carefully (or point me to a tutorial)? I use VTK6 for other projects, its been reinstalled, it would be ideal for me to do it that way.  

It looks like these:

VMTKHOME=/path-to-vmtk-build/Install 
export PATH=$VMTKHOME/bin:$PATH 
export DYLD_LIBRARY_PATH=$VMTKHOME/lib/vtk-5.10:$VMTKHOME/lib/vmtk:$VMTKHOME/lib/InsightToolkit:$DYLD_LIBRARY_PATH 
export PYTHONPATH=$VMTKHOME/bin/Python:$VMTKHOME/lib/vtk-5.10:$VMTKHOME/lib/vmtk:$PYTHONPATH

From installing from source is a good place to start. 

I've installed my copy through the binary (lion)

Luca Antiga

unread,
Sep 28, 2013, 4:36:49 PM9/28/13
to vmtk-...@googlegroups.com
Hi Jameson,
 can you please clarify what you'd like to know? I'm not sure I'm interpreting your question correctly, but I'll give it a shot.

Environment variables are explained in (probably too much) detail here

It's a set of symbols that are "seen" by a process and that inform the process about the environment it was started in. For instance, it will inform a process about what directories contain executable files that are visible system-wide and such.

On Mac and Linux, environment variables are set in "hidden" files in the user's home directory that are read and executed when a user logs in (I'm simplifying a little). I wrote "hidden" because, by convention, if a filename starts with a dot (e.g. ".foobar") it is not shown by the finder and it is treated as a hidden file.

On the Mac, the file in question is typically named ".profile". If you edit it with a text editor and add, say
export FOO=bar
(export is the command that exposes a symbol as an environment variable) then all programs starting from the shell will see FOO set as bar as part of the environment.

In the vmtk Installation description, it is suggested to add the following to .profile
source /Applications/vmtk.app/Contents/MacOS/vmtk
This line essentially executes the content of the [..]/MacOS/vmtk file when it loads the .profile file.
If you open /Applications/vmtk.app/Contents/MacOS/vmtk
with a text editor, you'll see that the file contains a bunch of definitions like the ones you pasted in your last email.

In case you need to only have the environment variables for vmtk defined when you need them, but not permanently, you can do the following:

First remove the above line from .profile in case you pasted it there. Then, when you need vmtk at the command line:
1. open a terminal
2. type
source /Applications/vmtk.app/Contents/MacOS/vmtk
3. start using vmtk in that terminal

Note that you'll have to repeat the above every time you open a new terminal window or tab.

Hope this helps

Luca
--
You received this message because you are subscribed to the Google Groups "vmtk-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vmtk-users+...@googlegroups.com.
To post to this group, send email to vmtk-...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


--
--
Luca Antiga, PhD
Principal Scientist, OROBIX Srl
via L.A. Muratori 3, 24123 Bergamo, Italy

web: www.orobix.com
mobile: +39.347.43.16.596

"This message originates from OROBIX Srl and its contents and attachments are privileged and confidential and are intended only for the individual(s) or entity(ies) named above. This message should not be forwarded, distributed or disclosed. Any unauthorized use, dissemination and duplication is strictly prohibited and may be unlawful. All personal messages express views solely of the sender, which are not to be attributed to OROBIX Srl, and may not be copied or distributed without this disclaimer. If you are not the intended recipient or received this message in error, please delete this message and notify the sender by reply e-mail. Opinions, conclusions and other information in this message that do not relate to the official business of OROBIX Srl shall be understood as neither given nor endorsed by it."

Reply all
Reply to author
Forward
0 new messages