[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Reply to: [list | sender only]
Re: CBF file structuring
- To: imgcif-l@bnl.gov
- Subject: Re: CBF file structuring
- From: Yves Epelboin <Yves.Epelboin@lmcp.jussieu.fr>
- Date: Thu, 06 Nov 1997 13:19:45 NFT
- In-Reply-To: Your message of "Wed, 05 Nov 1997 17:04:28 NFT." <199711051604.RAA01423@esrf.esrf.fr>
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]
- References:
- CBF file structuring (Andy Hammersley)
- Prev by Date: Correction of typos
- Next by Date: Simple file header
- Prev by thread: Re: CBF file structuring
- Next by thread: Missing Notice.
- Index(es):