Skip to content
Snippets Groups Projects
README.md 4.23 KiB
Newer Older
theazgra's avatar
theazgra committed
# Data compression project

### TODO *deadline* 25.2.2019
theazgra's avatar
theazgra committed
- [x] Tweak Z-Order reordering
theazgra's avatar
theazgra committed
  - Values, which are stored in more than one byte, must stay together.
  - Pixels, which contains more `channels`, can be separeted in final z order. (Try both separeted and not-separated)
    - Right now, when we `reorder` bytes we move *whole* pixel (*all channels*), but when pixel's channels will be separated we will move just one channel.
- [ ] Feed binary data to existing compressors and produce results (tables, graphs)
  - Try both data in their order and in `Z-order`
  - Compressors to try:
    - [x] gZip (zLib, huffman deflate combination)
theazgra's avatar
theazgra committed
    - [x] Bzip2
    - [x] LZMA (7-zip)
    - [x] Add *level* CLI option to specify compression level for above algorithms
theazgra's avatar
theazgra committed
    - [ ] Add CSV writer, which will write test results to file and test function taking folder with test files to parse.
    - [ ] *B3D cuda library*
    - [ ] Finish OpenMP parallelization.
theazgra's avatar
theazgra committed
- [ ] Look at *Image difference*
  - Negative values can be mapped to odd/even numbers. But the difference must be saved in more than one byte.
  - Save difference in different type than byte (`short`, `uint`, `ulong`)
- [ ] Compose results into paper.

Vojtech Moravec's avatar
Vojtech Moravec committed

## CZI parser TODO list
This is list of things, which have to be done first:
- [x] Parse `SubBlockDirectory` (there will be collection of `DirectoryEntryDV`'s)
  - [x] Exact copy of `DirectoryEntryDV` will be located in the referenced `SubBlock`
  - [x] Parse dimensions entries
theazgra's avatar
theazgra committed
- [x] Parse IEEE 4 / 8 byte float.
theazgra's avatar
theazgra committed
  - Parsing is done via `memcpy` call. Other alternative is using `union`, but double parsing wass't working with it. Later we can take a look on this and maybe improve the conversion and get rid of the copy.
- [x] Parse `SubBlock`
theazgra's avatar
theazgra committed
    - [ ] ~~Parse image data to proper pixel type~~. Do we really want to do that? We really care only about **bytes**. Parsing image data into some `PixelType` Matrix may be good, only if we want to do some operation on the image. This is moved to *later* section then.
- [x] Parse / extract image data from `SubBlock`
  - We are aware of position and size of the data in CZI file. With that two informations we can extract the data easily.
- [ ] Parse important informations from XML metadata (e.g. BitsPerPixel and compare with value from parsed binary data).
- [ ] Parse image values into matrices. `Matrix<Gray8>` etc.
- [ ] Support multi-file situations
theazgra's avatar
theazgra committed
  - [ ] Obtain multi-file CZI files. Currently we don't have any multi-files, so we can't really parse them. Secondary files should have different GUID than master file, also filepart should be different from 0. Files we have right now have (0) in their name, but theirs filepart is 0 and GUID of master file isn't set correctly.
  - [ ] One master file and more *secondary files* files (our current `CziFile` class kinda support that situations, so keep going that way)

Later on, we can extend our program to handle more things from the file, like:
- [ ] Parse metadata according to XML schemas
- [ ] Take a look on binary reader, can it be fastened up?
- [ ] Parse segments from memory buffer rather than from file stream. (*Disk bottleneck*)
theazgra's avatar
theazgra committed
- [ ] Parse image data to PixelType matrix type.

## Compression of images
- I tested [FLIF](https://flif.info/) compression on ~200 MB file. Compression ratio was good but the speed on the other hand was really bad. Decompression wasn't better, it was slow too.
theazgra's avatar
theazgra committed
  - Even lossy compression was slow. This compression is probably only good for small images.
Vojtěch Moravec's avatar
Vojtěch Moravec committed
- **Next step is to test B3D compression.**
- Pure LZW creates dictionary as it goes. Can create entries which aren't found in data.
- LZ77 is better variant.
- **Look at Huffman encoding, then maybe Arithmetic and in a spare time install nVidia drivers to test ot B3D library.** 
theazgra's avatar
theazgra committed

## Space filling (*Peano*) curves
- [Wikipedia](https://en.wikipedia.org/wiki/Space-filling_curve)
- Find out what is this about
- Look specifinally at [Z-order curve](https://en.wikipedia.org/wiki/Z-order_curve) and [Hilbert curve](https://en.wikipedia.org/wiki/Hilbert_curve)
- 
theazgra's avatar
theazgra committed


## Image difference
- Find difference between included images.
- Plot those differences and find out if certain images aren't same, just positioned little bit differently 
theazgra's avatar
theazgra committed
- *Pattern matching* - Find if there are some patterns in image sets.