<div dir="ltr"><br><div class="gmail_extra"><div class="gmail_quote">On Fri, Jul 22, 2016 at 12:11 PM, Magnus Elden <span dir="ltr"><<a href="mailto:magnus_elden@hotmail.com" target="_blank">magnus_elden@hotmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div lang="EN-US" link="#0563C1" vlink="#954F72"><div><p class="MsoNormal">I am trying to modify the SmartVolumeMapper example to read an .xdmf file, but I get an error when calling the Update() function.<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal" style="text-indent:0.5in">1 1'Value' not in itemProperties in XdmfTime::populateItem<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">The error above is all I have been able to get out of the function. What am I doing wrong? The .xdmf, .h5 and .hdf5 are all in the same folder and the “1 1” output before the error shows that it can be read. I am using VisualStudio 2015 and no other libraries than VTK. I am building everything as x64 Release. The error occurs between ‘1’ and ‘2’. (Please refer to the printf() calls below.)<u></u><u></u></p><p class="MsoNormal"><u></u></p></div></div></blockquote><div><br></div><div>Looks like a syntax error in the xdmf file. See the section about time in <a href="http://xdmf.org/index.php/XDMF_Model_and_Format">http://xdmf.org/index.php/XDMF_Model_and_Format</a> and if still stuck, post a snippet to the xdmf mailing list.</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div lang="EN-US" link="#0563C1" vlink="#954F72"><div><p class="MsoNormal"> <u></u></p><p class="MsoNormal">This is a minimal program that causes the error:<u></u><u></u></p><p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;color:gray">#include</span><span style="font-size:9.5pt;font-family:Consolas;color:black"> </span><span style="font-size:9.5pt;font-family:Consolas;color:rgb(163,21,21)"><vtkVersion.h></span><span style="font-size:9.5pt;font-family:Consolas;color:black"><u></u><u></u></span></p><p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;color:gray">#include</span><span style="font-size:9.5pt;font-family:Consolas;color:black"> </span><span style="font-size:9.5pt;font-family:Consolas;color:rgb(163,21,21)"><vtkSmartPointer.h></span><span style="font-size:9.5pt;font-family:Consolas;color:black"><u></u><u></u></span></p><p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;color:gray">#include</span><span style="font-size:9.5pt;font-family:Consolas;color:black"> </span><span style="font-size:9.5pt;font-family:Consolas;color:rgb(163,21,21)"><vtkSphere.h></span><span style="font-size:9.5pt;font-family:Consolas;color:black"><u></u><u></u></span></p><p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;color:gray">#include</span><span style="font-size:9.5pt;font-family:Consolas;color:black"> </span><span style="font-size:9.5pt;font-family:Consolas;color:rgb(163,21,21)"><vtkSampleFunction.h></span><span style="font-size:9.5pt;font-family:Consolas;color:black"><u></u><u></u></span></p><p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;color:gray">#include</span><span style="font-size:9.5pt;font-family:Consolas;color:black"> </span><span style="font-size:9.5pt;font-family:Consolas;color:rgb(163,21,21)"><vtkSmartVolumeMapper.h></span><span style="font-size:9.5pt;font-family:Consolas;color:black"><u></u><u></u></span></p><p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;color:gray">#include</span><span style="font-size:9.5pt;font-family:Consolas;color:black"> </span><span style="font-size:9.5pt;font-family:Consolas;color:rgb(163,21,21)"><vtkColorTransferFunction.h></span><span style="font-size:9.5pt;font-family:Consolas;color:black"><u></u><u></u></span></p><p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;color:gray">#include</span><span style="font-size:9.5pt;font-family:Consolas;color:black"> </span><span style="font-size:9.5pt;font-family:Consolas;color:rgb(163,21,21)"><vtkPiecewiseFunction.h></span><span style="font-size:9.5pt;font-family:Consolas;color:black"><u></u><u></u></span></p><p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;color:gray">#include</span><span style="font-size:9.5pt;font-family:Consolas;color:black"> </span><span style="font-size:9.5pt;font-family:Consolas;color:rgb(163,21,21)"><vtkRenderer.h></span><span style="font-size:9.5pt;font-family:Consolas;color:black"><u></u><u></u></span></p><p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;color:gray">#include</span><span style="font-size:9.5pt;font-family:Consolas;color:black"> </span><span style="font-size:9.5pt;font-family:Consolas;color:rgb(163,21,21)"><vtkRenderWindow.h></span><span style="font-size:9.5pt;font-family:Consolas;color:black"><u></u><u></u></span></p><p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;color:gray">#include</span><span style="font-size:9.5pt;font-family:Consolas;color:black"> </span><span style="font-size:9.5pt;font-family:Consolas;color:rgb(163,21,21)"><vtkRenderWindowInteractor.h></span><span style="font-size:9.5pt;font-family:Consolas;color:black"><u></u><u></u></span></p><p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;color:gray">#include</span><span style="font-size:9.5pt;font-family:Consolas;color:black"> </span><span style="font-size:9.5pt;font-family:Consolas;color:rgb(163,21,21)"><vtkVolumeProperty.h></span><span style="font-size:9.5pt;font-family:Consolas;color:black"><u></u><u></u></span></p><p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;color:gray">#include</span><span style="font-size:9.5pt;font-family:Consolas;color:black"> </span><span style="font-size:9.5pt;font-family:Consolas;color:rgb(163,21,21)"><vtkCamera.h></span><span style="font-size:9.5pt;font-family:Consolas;color:black"><u></u><u></u></span></p><p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;color:gray">#include</span><span style="font-size:9.5pt;font-family:Consolas;color:black"> </span><span style="font-size:9.5pt;font-family:Consolas;color:rgb(163,21,21)"><vtkImageShiftScale.h></span><span style="font-size:9.5pt;font-family:Consolas;color:black"><u></u><u></u></span></p><p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;color:gray">#include</span><span style="font-size:9.5pt;font-family:Consolas;color:black"> </span><span style="font-size:9.5pt;font-family:Consolas;color:rgb(163,21,21)"><vtkImageData.h></span><span style="font-size:9.5pt;font-family:Consolas;color:black"><u></u><u></u></span></p><p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;color:gray">#include</span><span style="font-size:9.5pt;font-family:Consolas;color:black"> </span><span style="font-size:9.5pt;font-family:Consolas;color:rgb(163,21,21)"><vtkPointData.h></span><span style="font-size:9.5pt;font-family:Consolas;color:black"><u></u><u></u></span></p><p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;color:gray">#include</span><span style="font-size:9.5pt;font-family:Consolas;color:black"> </span><span style="font-size:9.5pt;font-family:Consolas;color:rgb(163,21,21)"><vtkDataArray.h></span><span style="font-size:9.5pt;font-family:Consolas;color:black"><u></u><u></u></span></p><p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;color:gray">#include</span><span style="font-size:9.5pt;font-family:Consolas;color:black"> </span><span style="font-size:9.5pt;font-family:Consolas;color:rgb(163,21,21)"><vtkXMLImageDataReader.h></span><span style="font-size:9.5pt;font-family:Consolas;color:black"><u></u><u></u></span></p><p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;color:gray">#include</span><span style="font-size:9.5pt;font-family:Consolas;color:black"> </span><span style="font-size:9.5pt;font-family:Consolas;color:rgb(163,21,21)"><vtkXdmf3Reader.h></span><span style="font-size:9.5pt;font-family:Consolas;color:black"><u></u><u></u></span></p><p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;color:black"><u></u> <u></u></span></p><p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;color:blue">static</span><span style="font-size:9.5pt;font-family:Consolas;color:black"> </span><span style="font-size:9.5pt;font-family:Consolas;color:blue">void</span><span style="font-size:9.5pt;font-family:Consolas;color:black"> CreateImageData(</span><span style="font-size:9.5pt;font-family:Consolas;color:rgb(43,145,175)">vtkImageData</span><span style="font-size:9.5pt;font-family:Consolas;color:black">* </span><span style="font-size:9.5pt;font-family:Consolas;color:gray">im</span><span style="font-size:9.5pt;font-family:Consolas;color:black">);<u></u><u></u></span></p><p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;color:black"><u></u> <u></u></span></p><p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;color:blue">int</span><span style="font-size:9.5pt;font-family:Consolas;color:black"> main(</span><span style="font-size:9.5pt;font-family:Consolas;color:blue">int</span><span style="font-size:9.5pt;font-family:Consolas;color:black"> </span><span style="font-size:9.5pt;font-family:Consolas;color:gray">argc</span><span style="font-size:9.5pt;font-family:Consolas;color:black">, </span><span style="font-size:9.5pt;font-family:Consolas;color:blue">char</span><span style="font-size:9.5pt;font-family:Consolas;color:black"> *</span><span style="font-size:9.5pt;font-family:Consolas;color:gray">argv</span><span style="font-size:9.5pt;font-family:Consolas;color:black">[])<u></u><u></u></span></p><p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;color:black">{<u></u><u></u></span></p><p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;color:black"> </span><span style="font-size:9.5pt;font-family:Consolas;color:rgb(43,145,175)">vtkSmartPointer</span><span style="font-size:9.5pt;font-family:Consolas;color:black"><</span><span style="font-size:9.5pt;font-family:Consolas;color:rgb(43,145,175)">vtkXdmf3Reader</span><span style="font-size:9.5pt;font-family:Consolas;color:black">> reader =<u></u><u></u></span></p><p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;color:black"> </span><span style="font-size:9.5pt;font-family:Consolas;color:rgb(43,145,175)">vtkSmartPointer</span><span style="font-size:9.5pt;font-family:Consolas;color:black"><</span><span style="font-size:9.5pt;font-family:Consolas;color:rgb(43,145,175)">vtkXdmf3Reader</span><span style="font-size:9.5pt;font-family:Consolas;color:black">>::New();<u></u><u></u></span></p><p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;color:black"><u></u> <u></u></span></p><p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;color:black"> reader</span><span style="font-size:9.5pt;font-family:Consolas;color:teal">-></span><span style="font-size:9.5pt;font-family:Consolas;color:black">SetFileName(</span><span style="font-size:9.5pt;font-family:Consolas;color:rgb(163,21,21)">"C:/Users/NoobsDeSroobs/Downloads/testVolume.xdmf"</span><span style="font-size:9.5pt;font-family:Consolas;color:black">);<u></u><u></u></span></p><p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;color:black"> printf(</span><span style="font-size:9.5pt;font-family:Consolas;color:rgb(163,21,21)">"1 %d"</span><span style="font-size:9.5pt;font-family:Consolas;color:black"> , reader</span><span style="font-size:9.5pt;font-family:Consolas;color:teal">-></span><span style="font-size:9.5pt;font-family:Consolas;color:black">CanReadFile(</span><span style="font-size:9.5pt;font-family:Consolas;color:rgb(163,21,21)">"C:/Users/NoobsDeSroobs/Downloads/testVolume.xdmf"</span><span style="font-size:9.5pt;font-family:Consolas;color:black">));<u></u><u></u></span></p><p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;color:black"> reader</span><span style="font-size:9.5pt;font-family:Consolas;color:teal">-></span><span style="font-size:9.5pt;font-family:Consolas;color:black">Update();<u></u><u></u></span></p><p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;color:black"> printf(</span><span style="font-size:9.5pt;font-family:Consolas;color:rgb(163,21,21)">"2"</span><span style="font-size:9.5pt;font-family:Consolas;color:black">);<u></u><u></u></span></p><p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;color:black"> </span><span style="font-size:9.5pt;font-family:Consolas;color:blue">int</span><span style="font-size:9.5pt;font-family:Consolas;color:black"> numArrays = reader</span><span style="font-size:9.5pt;font-family:Consolas;color:teal">-></span><span style="font-size:9.5pt;font-family:Consolas;color:black">GetNumberOfPointArrays();<u></u><u></u></span></p><p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;color:black"> printf(</span><span style="font-size:9.5pt;font-family:Consolas;color:rgb(163,21,21)">"3"</span><span style="font-size:9.5pt;font-family:Consolas;color:black">);<u></u><u></u></span></p><p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;color:black"> </span><span style="font-size:9.5pt;font-family:Consolas;color:blue">for</span><span style="font-size:9.5pt;font-family:Consolas;color:black"> (</span><span style="font-size:9.5pt;font-family:Consolas;color:blue">int</span><span style="font-size:9.5pt;font-family:Consolas;color:black"> i = 0; i < numArrays; i++) {<u></u><u></u></span></p><p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;color:black"> printf(</span><span style="font-size:9.5pt;font-family:Consolas;color:rgb(163,21,21)">"Name of index %d is: %s"</span><span style="font-size:9.5pt;font-family:Consolas;color:black">, i, reader</span><span style="font-size:9.5pt;font-family:Consolas;color:teal">-></span><span style="font-size:9.5pt;font-family:Consolas;color:black">GetPointArrayName(i));<u></u><u></u></span></p><p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;color:black"> printf(</span><span style="font-size:9.5pt;font-family:Consolas;color:rgb(163,21,21)">"2"</span><span style="font-size:9.5pt;font-family:Consolas;color:black">);<u></u><u></u></span></p><p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;color:black"> }<u></u><u></u></span></p><p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;color:black"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:9.5pt;font-family:Consolas;color:black"> </span><span style="font-size:9.5pt;font-family:Consolas;color:blue">return</span><span style="font-size:9.5pt;font-family:Consolas;color:black"> 0;<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:9.5pt;font-family:Consolas;color:black">}<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:9.5pt;font-family:Consolas;color:black"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:9.5pt;font-family:Consolas;color:black"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:9.5pt;font-family:Consolas;color:black">Finally, I noticed that the standard way of copying the read data to the vtkImageData is by doing a shallow copy of the output of the reader, but </span><span style="font-size:9.5pt;font-family:Consolas">imageData->ShallowCopy(reader->GetOutput()) does not compile as GetOutput() does not exist. </span></p></div></div></blockquote><div><br></div><div>Use GetOutputData() this was an API change in VTK version 6.0. GetOutput() split into GetOutputPort() /* for connecting filters */ and GetOutputData() /* for getting the data object */</div><div><br></div><div>See <a href="http://www.vtk.org/Wiki/VTK/VTK_6_Migration/Replacement_of_SetInput">http://www.vtk.org/Wiki/VTK/VTK_6_Migration/Replacement_of_SetInput</a></div><div><br></div><div> <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div lang="EN-US" link="#0563C1" vlink="#954F72"><div><p class="MsoNormal"><span style="font-size:9.5pt;font-family:Consolas">I have a feeling this might have something to do with the fact that this is a 4D file and not a standard 3D file. <u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:9.5pt;font-family:Consolas"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:9.5pt;font-family:Consolas">If possible a working example would be great to have.<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:9.5pt;font-family:Consolas"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:9.5pt;font-family:Consolas">Finally, some functions like Update() and Read() are not listed in the documentation: <a href="http://www.vtk.org/doc/nightly/html/classvtkXdmf3Reader.html" target="_blank">http://www.vtk.org/doc/nightly/html/</a></span></p></div></div></blockquote><div><br></div><div>Navigate the inheritance hierarchy graph, or more easily click the "List of all members" link on the top right of the vtk doxygen page to see the methods of the ancestor classes as well as those implemented in the child class.</div><div><br></div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div lang="EN-US" link="#0563C1" vlink="#954F72"><div><p class="MsoNormal"><span style="font-size:9.5pt;font-family:Consolas"><a href="http://www.vtk.org/doc/nightly/html/classvtkXdmf3Reader.html" target="_blank">classvtkXdmf3Reader.html</a> Just a heads up.<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:9.5pt;font-family:Consolas"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:9.5pt;font-family:Consolas">Thank you so much for your help.<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:9.5pt;font-family:Consolas"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:9.5pt;font-family:Consolas">Yours,<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:9.5pt;font-family:Consolas">Magnus Elden<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:9.5pt;font-family:Consolas"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:9.5pt;font-family:Consolas"><u></u> <u></u></span></p><p class="MsoNormal"><u></u> <u></u></p></div></div><br>_______________________________________________<br>
Powered by <a href="http://www.kitware.com" rel="noreferrer" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" rel="noreferrer" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
<br>
Search the list archives at: <a href="http://markmail.org/search/?q=vtkusers" rel="noreferrer" target="_blank">http://markmail.org/search/?q=vtkusers</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://public.kitware.com/mailman/listinfo/vtkusers" rel="noreferrer" target="_blank">http://public.kitware.com/mailman/listinfo/vtkusers</a><br>
<br></blockquote></div><br></div></div>