[ITK-users] Do any of the mesh file formats store CellData?

DVigneault davis.vigneault at gmail.com
Mon Aug 17 06:57:13 EDT 2015


All--

I've rebuilt in debug mode and stepped through with gdb.  It looks like the
CellData is being deallocated at the following line in itkProcessObject.cxx. 
The comment suggests that this result is expected?

1684	  /**
1685	   * Prepare all the outputs. This may deallocate previous bulk data.
1686	   */
1687	  this->PrepareOutputs();

By putting a breakpoint at itkProcessObject.cxx:1687, we can see where the
pointer is being reset:

$ gdb ./dv-mesh-test 
(gdb) b itkProcessObject.cxx:1687
(gdb) r
(gdb) c # First time is due to sphere source
(gdb) select-frame 3 # Brings us back into itk::MeshFileWriter::Write
(gdb) p input->GetCellData() # A valid pointer
(gdb) n # Step over this 
(gdb) p input->GetCellData() # A null pointer

Here's the backtrace at that point:

#0  itk::ProcessObject::UpdateOutputData (this=0x936a30) at
/local/pemb3433/Developer/ITK/src/Modules/Core/Common/src/itkProcessObject.cxx:1695
#1  0x000000000052f9fd in itk::DataObject::UpdateOutputData (this=0x93b290)
at
/local/pemb3433/Developer/ITK/src/Modules/Core/Common/src/itkDataObject.cxx:416
#2  0x000000000052f6af in itk::DataObject::Update (this=0x93b290) at
/local/pemb3433/Developer/ITK/src/Modules/Core/Common/src/itkDataObject.cxx:341
#3  0x00000000004fb544 in itk::MeshFileWriter<itk::Mesh<float, 3u,
itk::DefaultStaticMeshTraits<float, 3u, 3u, float, float, float> >
>::Write (this=0x93ca40)
    at
/local/pemb3433/Developer/ITK/src/Modules/IO/Mesh/include/itkMeshFileWriter.hxx:148
#4  0x00000000004f9bf1 in itk::MeshFileWriter<itk::Mesh<float, 3u,
itk::DefaultStaticMeshTraits<float, 3u, 3u, float, float, float> >
>::Update (this=0x93ca40)
    at
/local/pemb3433/Developer/ITK/src/Modules/IO/Mesh/include/itkMeshFileWriter.h:145
#5  0x00000000004f8185 in main () at
/local/pemb3433/Developer/Bitbucket/oxford/Stebbing_Method/MeshTest/src/dv-mesh-test.cxx:32

I'm stretching my knowledge both of ITK and gdb here, so please do let me
know if I'm misinterpreting the output--but it seems to me that the CellData
is being deallocated when itkProcessObject.cxx:1687 is called, and therefore
it (a) isn't being written to file and (b) isn't available after the mesh is
written.

Is this a bug in my code?  A bug in ITK?  A feature I don't understand? 
Thanks very much in advance for your help!

Best,

--Davis



--
View this message in context: http://itk-insight-users.2283740.n2.nabble.com/Do-any-of-the-mesh-file-formats-store-CellData-tp7587666p7587689.html
Sent from the ITK Insight Users mailing list archive at Nabble.com.


More information about the Insight-users mailing list