Re: [Gdcm2] strange difference between GDCM 2.0.6 on Windows (32) and on Linux (32 and 64)
Cross-platform DICOM implementation
Brought to you by:
malat
From: Charl B. <c.p...@tu...> - 2008-06-27 23:04:10
|
Mathieu, you are a genius!! What an obscure bug, I would never have caught this. The current official johannes VTK is a heavily patched VTK PV 3-2-1. I'll just patch it further with your changes. Hmmm, it does work if I change the order, i.e. put vtkgdcm riiiight before VTK. However, I'd like for it to work any way (can't guarantee the order in my application), so I've applied the 1.14 patch. Still problems... will continue diagnosing. Thanks again, Charl On Sat, Jun 28, 2008 at 12:44 AM, Mathieu Malaterre <mat...@gm...> wrote: > Charl, > > I bet you just hit the RTTI + python thingy. > > Are you using VTK 5.2 ? If not, on Linux 64 bits (at least) please > import vtkgdcm as the very first module (before vtk). > > http://www.vtk.org/pipermail/vtk-developers/2008-May/005133.html > > My patch was merged in time for VTK 5.2, I know you can import > partial patch from VTK CVS, please import the one > > http://public.kitware.com/cgi-bin/viewcvs.cgi/Wrapping/Python/vtk/__init__.py?r1=1.13&r2=1.14 > > HTH > -Mathieu > > On Sat, Jun 28, 2008 at 12:39 AM, Charl Botha <c.p...@tu...> wrote: >> On Sat, Jun 28, 2008 at 12:28 AM, Mathieu Malaterre >> <mat...@gm...> wrote: >>> Sure ! Please send me the link. >> >> It gets a bit stranger. Look what I can do on this Linux system: >> >>>>> import gdcm >>>>> r = gdcm.Reader() >>>>> r.SetFileName('tosh_data') >>>>> r.Read() >> True >>>>> f = r.GetFile() >>>>> ds = f.GetDataSet() >>>>> de = ds.GetDataElement(gdcm.Tag(0x0010,0x0010)) >>>>> bv = de.GetByteValue() >>>>> print bv >> KNIEKOOS >>>>> print bv.GetPointer() >> KNIEKOOS >> >> So I can read the PatientName using just GDCM. However, when I >> instrument vtkGDCMImageReader::GetStringValueFromTag() as follows: >> >> if( ds.FindDataElement( t ) ) >> { >> cout << "Found DataElement" << endl; >> const gdcm::DataElement& de = ds.GetDataElement( t ); >> const gdcm::ByteValue *bv = de.GetByteValue(); >> cout << "bv " << bv << endl; >> if( bv ) // Can be Type 2 >> { >> >> and rebuild, I get the following: >> >> PatientName >> Found DataElement >> bv 0 >> END PatientName >> >> Why is bv now 0? It doesn't even enter the clause where it can return >> the string. I could just read it fine in Python (exact same >> environment, the same terminal window in fact!) >> >> The value is somehow getting lost even before it touches the >> vtkMedicalImageProperties. >> >> Any ideas, hints or tips would be welcome!! >> >> See you, >> Charl >> > > > > -- > Mathieu > > -- dr. charl p. botha :: http://visualisation.tudelft.nl/CharlBotha work: c.p...@tu... personal: cp...@cp... |