Error sEEG electrode coregistration post implant CT

Attempting to add CT to coregister sEEG electrode locations. I selected "SPM" to register volume and then "No" for reslicing the volume, per the online tutorial. This resulted in the following error: "Line 152: Undefined function 'spm_jobman' for input arguments of type 'char'". MRI was previously segmented using Brainsuite and did have "MNI normalization". When I select "MNI" instead of "SPM" for importing the CT it works, but my understanding is this is less accurate, although the result seems good to me (screen shot attached). Regardless, I cannot get any of these images to show up in "functional data" for the subject in order to manually coregister electrode locations. When I go to "EDF channels" and click "MRI registration" I only have the option to "refine using head points" and do not have any option for editing channel locations, as is depicted in the tutorial. Please advise.

Thanks,
Ben

image

This resulted in the following error: "Line 152: Undefined function 'spm_jobman' for input arguments of type 'char'".

What you are doing is correct, but SPM seems improperly set up on your computer.
Remove all the references to SPM in your Matlab path, then let Brainstorm install it as a plugin:
https://neuroimage.usc.edu/brainstorm/Tutorials/Plugins

I'd recommend you start by following the SEEG and ECOG tutorials with the example datasets provided. It would allow you to make sure everything works on your computer and that you understood everything before trying with your own data.

When I go to "EDF channels" and click "MRI registration" I only have the option to "refine using head points" and do not have any option for editing channel locations, as is depicted in the tutorial.

You probably have to define your electrodes as being SEEG first.
https://neuroimage.usc.edu/brainstorm/Tutorials/ECoG#Edit_the_channel_types

Thanks for your quick response. I had previously installed SPM via Brainstorm plugin but went ahead and tried again. Using the tutorial data, I'm getting the following error when attempting the SPM coregistration:

30-Nov-2022 20:41:52 - Running job #1
------------------------------------------------------------------------
30-Nov-2022 20:41:52 - Running 'Coregister: Estimate'

SPM12: spm_coreg (v7320)                           20:41:52 - 30/11/2022
========================================================================
Warning: You have used 'state' to read the internal state of a uniform random number generator that is not currently
active, which most likely returns a result that is not valid.  This syntax is not recommended.  See Replace Discouraged
Syntaxes of rand and randn to use RNG to replace the old syntax. 
Warning: Using 'state' to set RAND's internal state causes RAND, RANDI, and RANDN to use legacy random number generators.
This syntax is not recommended.  See Replace Discouraged Syntaxes of rand and randn to use RNG to replace the old syntax. 
Completed                               :          20:42:13 - 30/11/2022
30-Nov-2022 20:42:13 - Done    'Coregister: Estimate'
30-Nov-2022 20:42:13 - Done

It does create an image, but looking at the overlay, it looks like it's not accounting for the brain sag from grid implant (see attached).

There is no error in the output you reported.
You can safely ignore all these warnings.

It does create an image, but looking at the overlay, it looks like it's not accounting for the brain sag from grid implant (see attached).

There is no compensation for the brain shift caused by the implanted grid, indeed.
This is on our infinite todo list: https://neuroimage.usc.edu/brainstorm/Next#ECOG.2FSEEG

You are welcome to share suggestions to handle this problem, or even propose code changes on the Brainstorm GitHub repository.