<div dir="ltr"><div>Davis,<br><br></div>Can you write a c++ example (please not a c++-11 one) along with corresponding cmakelists.txt either on itk wiki examples [1], either on ITKExamples [2] (see [3] for contributing), please?<br><br>Thanks,<br>Arnaud<br><br>[1] <a href="http://itk.org/Wiki/ITK/Examples">http://itk.org/Wiki/ITK/Examples</a><br>[2] <a href="http://itk.org/ITKExamples/index.html">http://itk.org/ITKExamples/index.html</a><br>[3] <a href="http://itk.org/ITKExamples/Documentation/Contribute/index.html">http://itk.org/ITKExamples/Documentation/Contribute/index.html</a><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Aug 17, 2015 at 12:57 PM, DVigneault <span dir="ltr"><<a href="mailto:davis.vigneault@gmail.com" target="_blank">davis.vigneault@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">All--<br>
<br>
I've rebuilt in debug mode and stepped through with gdb.  It looks like the<br>
CellData is being deallocated at the following line in itkProcessObject.cxx.<br>
The comment suggests that this result is expected?<br>
<br>
1684      /**<br>
1685       * Prepare all the outputs. This may deallocate previous bulk data.<br>
1686       */<br>
1687      this->PrepareOutputs();<br>
<br>
By putting a breakpoint at itkProcessObject.cxx:1687, we can see where the<br>
pointer is being reset:<br>
<br>
$ gdb ./dv-mesh-test<br>
(gdb) b itkProcessObject.cxx:1687<br>
(gdb) r<br>
(gdb) c # First time is due to sphere source<br>
(gdb) select-frame 3 # Brings us back into itk::MeshFileWriter::Write<br>
(gdb) p input->GetCellData() # A valid pointer<br>
(gdb) n # Step over this<br>
(gdb) p input->GetCellData() # A null pointer<br>
<br>
Here's the backtrace at that point:<br>
<br>
#0  itk::ProcessObject::UpdateOutputData (this=0x936a30) at<br>
/local/pemb3433/Developer/ITK/src/Modules/Core/Common/src/itkProcessObject.cxx:1695<br>
#1  0x000000000052f9fd in itk::DataObject::UpdateOutputData (this=0x93b290)<br>
at<br>
/local/pemb3433/Developer/ITK/src/Modules/Core/Common/src/itkDataObject.cxx:416<br>
#2  0x000000000052f6af in itk::DataObject::Update (this=0x93b290) at<br>
/local/pemb3433/Developer/ITK/src/Modules/Core/Common/src/itkDataObject.cxx:341<br>
#3  0x00000000004fb544 in itk::MeshFileWriter<itk::Mesh&lt;float, 3u,<br>
itk::DefaultStaticMeshTraits&lt;float, 3u, 3u, float, float, float> ><br>
>::Write (this=0x93ca40)<br>
    at<br>
/local/pemb3433/Developer/ITK/src/Modules/IO/Mesh/include/itkMeshFileWriter.hxx:148<br>
#4  0x00000000004f9bf1 in itk::MeshFileWriter<itk::Mesh&lt;float, 3u,<br>
itk::DefaultStaticMeshTraits&lt;float, 3u, 3u, float, float, float> ><br>
>::Update (this=0x93ca40)<br>
    at<br>
/local/pemb3433/Developer/ITK/src/Modules/IO/Mesh/include/itkMeshFileWriter.h:145<br>
#5  0x00000000004f8185 in main () at<br>
/local/pemb3433/Developer/Bitbucket/oxford/Stebbing_Method/MeshTest/src/dv-mesh-test.cxx:32<br>
<br>
I'm stretching my knowledge both of ITK and gdb here, so please do let me<br>
know if I'm misinterpreting the output--but it seems to me that the CellData<br>
is being deallocated when itkProcessObject.cxx:1687 is called, and therefore<br>
it (a) isn't being written to file and (b) isn't available after the mesh is<br>
written.<br>
<br>
Is this a bug in my code?  A bug in ITK?  A feature I don't understand?<br>
Thanks very much in advance for your help!<br>
<br>
Best,<br>
<br>
--Davis<br>
<br>
<br>
<br>
--<br>
View this message in context: <a href="http://itk-insight-users.2283740.n2.nabble.com/Do-any-of-the-mesh-file-formats-store-CellData-tp7587666p7587689.html" rel="noreferrer" target="_blank">http://itk-insight-users.2283740.n2.nabble.com/Do-any-of-the-mesh-file-formats-store-CellData-tp7587666p7587689.html</a><br>
<div class="HOEnZb"><div class="h5">Sent from the ITK Insight Users mailing list archive at Nabble.com.<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<br>
<a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Kitware offers ITK Training Courses, for more information visit:<br>
<a href="http://www.kitware.com/products/protraining.php" rel="noreferrer" target="_blank">http://www.kitware.com/products/protraining.php</a><br>
<br>
Please keep messages on-topic and check the ITK FAQ at:<br>
<a href="http://www.itk.org/Wiki/ITK_FAQ" rel="noreferrer" target="_blank">http://www.itk.org/Wiki/ITK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://public.kitware.com/mailman/listinfo/insight-users" rel="noreferrer" target="_blank">http://public.kitware.com/mailman/listinfo/insight-users</a><br>
</div></div></blockquote></div><br></div>