Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FIX] display error when impossible slice timing values are given #969

Merged
merged 7 commits into from
Mar 29, 2023

Conversation

Remi-Gau
Copy link
Contributor

fixes #967

@JacMatu
Copy link

JacMatu commented Mar 28, 2023

Running the script produced an error

[14:07:39] bidspm - INFO				getAndCheckSliceOrder
 SLICE TIMING INFORMATION EXTRACTED FROM METADATA.

[14:07:39] bidspm - INFO				

[14:07:39] bidspm - ERROR				getAcquisitionTime
Acquisition time cannot be < to any slice timing value:

Current values:
- acquisition time: 1.942857
- slice timing 
	-      0
	- 0.0575
	-  0.115
	- 0.1725
	-   0.23
	- 0.2875
	-  0.345
	- 0.4025
	-   0.46
	- 0.5175
	-  0.575
	- 0.6325
	-   0.69
	-  0.745
	- 0.8025
	-   0.86
	- 0.9175
	-  0.975
	- 1.0325
	-   1.09
	- 1.1475
	-  1.205
	- 1.2625
	-   1.32
	- 1.3775
	-  1.435
	- 1.4925
	-   1.55
	- 1.6075
	-  1.665
	- 1.7225
	- 1.7775
	-  1.835
	- 1.8925
	-   1.95


 Error getAcquisitionTime:sliceTimingSuperiorToAcqTime occurred:
	- Error in errorHandling
		line 57 in /Users/jacekmatuszewski/Documents/Language_MVPA/bidspm/src/messages/errorHandling.m
	- Error in logger
		line 70 in /Users/jacekmatuszewski/Documents/Language_MVPA/bidspm/src/messages/logger.m
	- Error in getAcquisitionTime
		line 31 in /Users/jacekmatuszewski/Documents/Language_MVPA/bidspm/src/preproc/utils/getAcquisitionTime.m
	- Error in setBatchSTC
		line 66 in /Users/jacekmatuszewski/Documents/Language_MVPA/bidspm/src/batches/preproc/setBatchSTC.m
	- Error in bidsSTC
		line 47 in /Users/jacekmatuszewski/Documents/Language_MVPA/bidspm/src/workflows/preproc/bidsSTC.m
	- Error in preprocess
		line 247 in /Users/jacekmatuszewski/Documents/Language_MVPA/bidspm/bidspm.m
	- Error in executeAction
		line 147 in /Users/jacekmatuszewski/Documents/Language_MVPA/bidspm/bidspm.m
	- Error in bidspm
		line 79 in /Users/jacekmatuszewski/Documents/Language_MVPA/bidspm/bidspm.m
	- Error in step_1_bidspm_preprocess
		line 24 in /Users/jacekmatuszewski/Documents/Language_MVPA/Data/BIDS_Nifti/code/step_1_bidspm_preprocess.m

error log attached

error_2023-03-28T14-07.log

@Remi-Gau
Copy link
Contributor Author

OK this is a rounding error on my side

will fix that

@Remi-Gau
Copy link
Contributor Author

I tested with values and assuming that you have a TR of 2 seconds.

It should work now.

@JacMatu
Copy link

JacMatu commented Mar 28, 2023

bidspm();

results in

Unrecognized function or variable 'bugReport'.

Error in bidspm (line 85)
    bugReport(opt, ME);

Is there a quick fix for that? Is that some kind of dev debugging mode?

@Remi-Gau
Copy link
Contributor Author

The function should be there in the version 3.0.0 you are using:

https://github.com/cpp-lln-lab/bidspm/blob/main/src/messages/bugReport.m

It is the function that will write a bug report when something fails.

If you get this error it means that bidspm may not have been properly initialised.

What command did you run?

@Remi-Gau
Copy link
Contributor Author

wait... you just ran bidspm() and got this error?

let me check

@Remi-Gau
Copy link
Contributor Author

@JacMatu try updating again from my branch

I could reproduce the error you are getting but at least now we should know more about why bidspm() failed to run.

@JacMatu
Copy link

JacMatu commented Mar 28, 2023 via email

@Remi-Gau
Copy link
Contributor Author

Cool.
Merging this then.

@Remi-Gau Remi-Gau merged commit d29096c into cpp-lln-lab:main Mar 29, 2023
13 checks passed
@Remi-Gau Remi-Gau deleted the fix-acq_time_error branch March 29, 2023 09:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] 'pattern' error during BUILDING JOB: slice timing correction
2 participants