Skip to content
This repository was archived by the owner on Apr 19, 2023. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions utils/interpolate.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ def get_parser():
'-t', '--tmask', action='store', required=True,
help='[required]'
'\nTemporal mask indicating whether each volume is seen or '
'\nunseen. For instance, 1 (or >1) indicates that a volume '
'\nshould be scrubbed, while 0 would indicate that the '
'\nvolume should be retained.')
'\nunseen. For instance, 1 indicates that a volume '
'\nshould be retained, while 0 would indicate that the '
'\nvolume should be fixed.')
parser.add_argument(
'-m', '--mask', action='store',
help='\nSpatial mask indicating the voxels of the input image '
Expand Down Expand Up @@ -81,7 +81,7 @@ def get_parser():

tmask = np.loadtxt(opts.tmask)
indices = tmask.shape[-1]
t_obs=np.array(np.where(tmask != 0))
t_obs=np.array(np.where(tmask == 0))

##########################################################################
# Total timespan of seen observations, in seconds
Expand All @@ -99,8 +99,9 @@ def get_parser():
n_samples_seen = seen_samples.shape[-1]
if n_samples_seen == nvol:
raise ValueError('No interpolation is necessary for this dataset.')
#if n_samples_seen / nvol > 0.7:
#raise ValueError('More than 70% of the timepoints are to be interpolated.')
if n_samples_seen / nvol > 0.7:
raise ValueError('More than 70% ({}%) of the timepoints are to be interpolated.'.format(
100.0 * n_samples_seen / nvol))
##########################################################################
# Temoral indices of all observations, seen and unseen
##########################################################################
Expand Down