-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
38 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import pytest | ||
from pcntoolkit.normative import load_response_vars | ||
from pcntoolkit.dataio import fileio | ||
# from dataio import fileio | ||
|
||
import numpy as np | ||
|
||
def create_dummy_data(): | ||
# Create a dummy 3D array for the datafile | ||
data = np.random.rand(10, 10, 10) | ||
|
||
# Create a dummy 3D array for the maskfile | ||
mask = np.ones((10, 10, 10)) | ||
|
||
return data, mask | ||
|
||
# Use the function to create the dummy data | ||
data, mask = create_dummy_data() | ||
|
||
# Store the dummy data on disk | ||
datafile = 'test_data.nii.gz' | ||
maskfile = 'test_mask.nii.gz' | ||
fileio.save_nifti(data, datafile) | ||
fileio.save_nifti(mask, maskfile) | ||
|
||
|
||
def test_load_response_vars(): | ||
|
||
# Call the function with the test inputs | ||
Y, volmask,my_str = load_response_vars(datafile, maskfile, vol=True) | ||
|
||
# Assert that the function returns the expected results | ||
# This will depend on what you expect the function to return | ||
# For example, you might check that Y and volmask are not None | ||
assert Y is not None | ||
assert volmask is not None | ||
assert my_str == 'test' |