Discussion List Archives

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: CBF file structuring

Following is a short comment on Andy's proposal for file structuring.

It looks very nice!

Yves


> 3. The very start of the file has an identification item (2). This item
>    also describes the CBF version or level. The identifier is:
> 
> ###_CRYSTALLOGRAPHIC_BINARY_FILE: VERSION
> 
> (QUESTION: Should all identifiers be case sensitive or not ? Presently
> I'm assuming that they're all upper-case only.)

Modern style of programing makes a distinction between upper and lower case, 
thus my answer is yes.


> The ASCII part is:
> 
> ###_START_OF_BIN
> 
>...

>    o Bytes 25-32 define the length of the binary section. 

Should be written: length in bytes of the binary section

> 
>      This value may be set to zero if this is the last binary section or 
>      header section in the file. This allows a program writing, for
>      example, a single compressed image to avoid having to rewind the
>      file to write the size of the compressed data. (For small files
>      compression within memory may be practical, and this may not be an
>      issue. However very large files exist where writing the compressed
>      data "on the fly" may be the only realistic method.)
> 
>      Since the data may be have been compressed, knowing the numbers
>      of elements and size of each element does not necessary tell a
>      program how many bytes to jump over, of here it stored explicitly.
>      This also means that the reading program does not have encode
>      information in the header section section to move through the
>      file.

We should recommend not to use this possibility. The fwrite function allows to 
come back in a written file to modify or write some data. Thus the length of 
the compressed binary section may be written AFTER compression. Having this 
data is important to check if the file has been properly written or 
transmitted through the network. It is not related to the number of pixels in 
the image but to the number of bytes in the binary part.

Using the value 0 both to indicate no more binary part or size unknown makes 
the software more complicated since it must check the EOF to distinguish both 
cases.
 

Regards,

Yves
-- 
___________________________________________________

 Yves EPELBOIN                                          
 E-mail: epelboin@lmcp.jussieu.fr - http://www.lmcp.jussieu.fr/~epelboin
      Universite Pierre et Marie Curie, Paris VI
      Case  115 -- 4, place Jussieu --  F-75252 Paris Cedex 05
      phone: (00 33)  01 44 27 52 11   --   fax: (00 33) 01 44 27 37 85



Reply to: [list | sender only]
International Union of Crystallography

Scientific Union Member of the International Science Council (admitted 1947). Member of CODATA, the ISC Committee on Data. Partner with UNESCO, the United Nations Educational, Scientific and Cultural Organization in the International Year of Crystallography 2014.

International Science Council Scientific Freedom Policy

The IUCr observes the basic policy of non-discrimination and affirms the right and freedom of scientists to associate in international scientific activity without regard to such factors as ethnic origin, religion, citizenship, language, political stance, gender, sex or age, in accordance with the Statutes of the International Council for Science.