Skip to content

Commit

Permalink
Cosmetics
Browse files Browse the repository at this point in the history
  • Loading branch information
ofgulban committed Feb 27, 2023
1 parent 1096b23 commit 27f91bb
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
11 changes: 6 additions & 5 deletions bvbabel/roi.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import numpy as np


# =============================================================================
def read_roi(filename):
"""Read BrainVoyager ROI file, FileVersion = 6.
Expand Down Expand Up @@ -32,7 +33,7 @@ def read_roi(filename):
header[content[0]] = int(content[1])
else:
header[content[0]] = content[1]

# ROI data (x, y, z coordinates of voxels)
count_roi = -1
data_roi = list()
Expand All @@ -48,16 +49,16 @@ def read_roi(filename):

elif content[0] == "FromSlice":
data_roi[count_roi]["FromSlice"] = int(content[1])

elif content[0] == "Left":
data_roi[count_roi]["Left"] = int(content[1])

elif content[0] == "Right":
data_roi[count_roi]["Right"] = int(content[1])

elif content[0] == "Top":
data_roi[count_roi]["Top"] = int(content[1])

elif content[0] == "Bottom":
data_roi[count_roi]["Bottom"] = int(content[1])

Expand Down
1 change: 1 addition & 0 deletions bvbabel/sdm.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ def write_sdm(filename, header, data_sdm):
else:
f.write("\n")


def create_sdm():
"""Create BrainVoyager SDM file with default values.
Expand Down
6 changes: 5 additions & 1 deletion examples/read_write_fmr.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,17 @@

import os
import bvbabel
from pprint import pprint

FILE = "/home/faruk/Documents/test_bvbabel/fmr/nifti_converted.fmr"
FILE = "/home/faruk/Documents/test_bvbabel/S01_RUN_01_SCSTBL_3DMCTS_LTR_THPGLMF6c_TDTS2.0dp_FLIRT_TU.fmr"

# =============================================================================
# Load FMR (and its paired STC file)
header, data = bvbabel.fmr.read_fmr(FILE)

# See header information
pprint(header)

# Save FMR (and its paired STC file)
basename = FILE.split(os.extsep, 1)[0]
outname = "{}_bvbabel.fmr".format(basename)
Expand Down

0 comments on commit 27f91bb

Please sign in to comment.