[IGSTK-Developers] Questions
Luis Ibanez
luis.ibanez at kitware.com
Thu Nov 30 17:53:51 EST 2006
Hi Ziv,
Thanks for pointing out these issues:
0) Patrick already pointed out this problem in our past tcon.
We all agree that this must be changed, but haven't arrived
to a consensus on what the appropriate mechanism to use.
1) I agree we should not use enums at all. They are unsafe.
For the compiler they are equivalent to integers, and there
is no way to restrict their range when used as arguments to
functions. Replacing them with tokens sounds like a great
idea to me.
2) We talked about formal representations of float/double values
in XML. You are right in that the written value may not match
the read value. There is also a question of how different the
values will be. That is, a question of precision. Storing
binary data must be done carefully too, because different
platforms store data in different ways. Even Visual Studio
have two ways of representing doubles, one with the IEEE
convention and another one with the 48 bits convention. This
requires further discussion.
3) Encoding data in XML binary is an option... but again, it
requires discussion. BTW we (Kitware) have been doing XML
binaries for other applications that also require encryption
and authentication, so there is material that we could leverage
for IGSTK.
4) Why CanRead() the file reads the file is a good questions.
This may require an additional code review. There are some
cases where the only way to make sure that a reader can
read a file is to actually try to parse it entirely.
I'm not sure if this is the case of the XML tool calibration
reader.
You may want to insert these topics in the agenda for the next
monthly tcon.
Keep in mind that most we will not be able to do any more
development until the new IGSTK funding starts next year.
Maybe we should create bug entries with these issues to make
sure that they don't fall through the cracks and we forget
about them.
Thanks
Luis
=====================
Ziv Yaniv wrote:
> Hi all,
>
> A couple of comments/questions about IGSTK (I decided to annoy everyone,
> not just Patrick):
>
>
> 0. Why are there only four com ports (enums) defined in the
> SerialCommunication class?
>
> 1. Why are enums used in the communication classes (SerialCommunication
> - baud rate etc., SocketCommunication - SocketUsageType) and not Tokens
> that guarantee both type safety and valid values?
>
> 2. Why is the tool calibration data read as floats (if I remember
> correctly VTK transitioned to double). More importantly, why is the
> calibration data read from an XML file as ASCII data and not binary?
> ASCII will not reflect the original value in the variables. Running the
> "same" program twice , calibration and continue vs. read calibration and
> continue, will give different results.
>
> After taking a look at the itk classes for reading/writing transform
> files (itk::TransformFileWriter/itk::TransformFileReader) I saw they
> have the same problem, data is written in ASCII.
>
> 3. Any plans to encode binary data in XML files (like in the "good" old
> days when binary data was sent via email after uuencoding it) or is
> object serialization in the cards?
>
> 4. Why does the igstk::XMLToolCalibrationReader::CanReadFile() method
> actually read the file? The side effect of loading the file is then used
> in the ToolCalibrationReader<TCalibration>::ParseXML() method.
>
> thanks
> Ziv
>
>
More information about the IGSTK-Developers
mailing list