Skip to content

Commit

Permalink
update demo and remove __name__ in module
Browse files Browse the repository at this point in the history
  • Loading branch information
tab-cmd committed Nov 13, 2024
1 parent c5eb3d7 commit d3bf154
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 20 deletions.
12 changes: 0 additions & 12 deletions bcipy/io/convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -400,15 +400,3 @@ def norm_to_tobii(norm_units: Tuple[float, float]) -> Tuple[float, float]:
tobii_x = (norm_units[0] / 2) + 0.5
tobii_y = ((norm_units[1] * -1) / 2) + 0.5
return (tobii_x, tobii_y)


if __name__ == "__main__":

convert_to_bids(
data_dir='/Users/scitab/Desktop/2024-10-25_13-58-11/RSVP_Calibration_2024-10-25_13-58-11',
participant_id='04',
session_id='01',
run_id='01',
output_dir='./bids/',
format=ConvertFormat.BV
)
26 changes: 18 additions & 8 deletions bcipy/io/demo/demo_convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,18 +44,28 @@ def convert_study_to_bids(directory: str, experiment_id: str, format: ConvertFor
'--directory',
help='Path to the directory with raw_data to be converted',
required=False)
parser.add_argument(
'-e',
'--experiment',
help='Experiment ID to convert',
default='default',
)

args = parser.parse_args()

path = args.directory
if not path:
path = load_experimental_data()

convert_to_bids(
data_dir=path,
participant_id='01',
session_id='01',
run_id='01',
output_dir='./bids/',
format=ConvertFormat.BV
)
# uncomment to convert a single session
# convert_to_bids(
# data_dir=path,
# participant_id='01',
# session_id='01',
# run_id='01',
# output_dir='./bids/',
# format=ConvertFormat.BV
# )

# convert a study to BIDS format
convert_study_to_bids(path, args.experiment, ConvertFormat.BV)

0 comments on commit d3bf154

Please sign in to comment.