ofgulban / bvbabel

A lightweight Python library for reading & writing BrainVoyager file formats.
MIT License
19 stars 11 forks source link

Add example for working with SRF and POI files #33

Open ofgulban opened 1 year ago

ofgulban commented 1 year ago

It would be useful to have an showing how to work with SRF (triangular mesh surface) and POI (patches of interest) files.

Example can be based on this dataset: https://search.kg.ebrains.eu/instances/Dataset/ff71a4d1-ea14-4ed6-898e-b92d95b3c446

image *image from https://github.com/ofgulban/cortical-auditory-atlas .

ofgulban commented 1 year ago

Added an example script (with https://github.com/ofgulban/bvbabel/commit/68186d241831658bdb006b5f590f8120163263b0 ), see: examples/read_srf_and_poi_export_obj.py script.

This script:

  1. reads an SRF and a POI file (they need to have matching number of vertices).
  2. Extracts the surface geometry from the SRF file.
  3. Extract patch information from the POI file.
  4. Exports these information into a wavefront obj file

Screenshots below are taken from BrainVoyager v 22.4.4 (left) and after the "SRF and POI to colored OBJ" conversion (taken from MeshLab v1.3.2, on the right) SRF_POI_to_OBJ

Data used in this example is here: example_data_SRF_POI.zip