Skip to content
forked from kuba--/zip

A portable, simple zip library written in C

License

Notifications You must be signed in to change notification settings

neurolabusc/zip

 
 

Repository files navigation

Introduction

Different scientific tools use different file formats to store tractography streamlines such as Camino BFloat, DTI Studio DAT, DTI-query/CINCH PDB, MRtrix TCK, TrackVis TRK, VTK's FIB/VTK format. Each format has inherent strengths and limitations. A team of scientists discussed the need for a unified format, and created a document describing potential formats that address weaknesses of existing formats.

Based on this discussion, Francois Rheault created a Python implementation for creating and reading a new format named TRX. This format uses the popular zip format as container to store tractography data.

This repository explores how C code could be used to create a simple library for working with this format. The foundation is a simple C wrapper for zip. The current implementation uses Rich Geldreich's elegant miniz to extract and compress the deflated data. This single-file compression code simplifies development, though a deployed product could leverage accelerated deflate libraries.

This project is still in development.

Examples

  • Report the contents of a trx file:
gcc  -I../src/miniz.h ../src/zip.c trxtest.c -o tst; ./ts
[0]: header.json
[1]: positions.3.float16
[2]: offsets.uint64
[3]: dps/commit_weights.float32
[4]: dps/commit_colors.3.uint8
...
[26]: dpv/color_z.uint8
ALL TEST SUCCESS!

About

A portable, simple zip library written in C

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C 92.8%
  • CMake 6.7%
  • Shell 0.5%