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

[BUG]: THOMAS docker call broken #1172

Closed
tfoutz99 opened this issue Mar 30, 2024 · 3 comments
Closed

[BUG]: THOMAS docker call broken #1172

tfoutz99 opened this issue Mar 30, 2024 · 3 comments
Labels

Comments

@tfoutz99
Copy link

tfoutz99 commented Mar 30, 2024

When calling ea_thomas.m, it crashes when trying to pull a docker image.
Click on tools -> run thomas
Windows
Matlab R2023b
Lead-DBS 3.1
downloaded from website

I had to change:
ea_checkDocker('dockerImage');
to:
ea_checkDocker(dockerImage);

to get docker to pull the repo. However, it still crashes with not being able to open the working directory:

Running THOMAS segmentation...

docker: Error response from daemon: the working directory 'C:\Users\tomfo\local\local-leaddbs\leaddbs\derivatives\leaddbs\sub-pt002\thomas' is invalid, it needs to be an absolute path.
See 'docker run --help'.
Warning: Escaped character '\B' is not valid. See 'doc sprintf' for supported special characters. 
> In ea_thomas (line 61)
In ea_thomas_menu (line 34)
In ea_menu_initmenu>@(~,~)ea_thomas_menu(handles) (line 47)
In matlab.ui.internal.controller/WebMenuController/fireMenuSelectedEvent (line 85)
In matlab.ui.internal.controller/WebMenuController/handleEvent (line 55)
In matlab.ui.internal.controller.WebMenuController>@(varargin)obj.handleEvent(varargin{:}) (line 36)
In viewmodel.internal.factory.ManagerFactoryProducer>@(src,event)callback(src,viewmodel.internal.factory.ManagerFactoryProducer.convertStructToEventData(event)) (line 79) 
Building atlas table...
@tfoutz99 tfoutz99 added the bug label Mar 30, 2024
@tfoutz99
Copy link
Author

I think I got it to work. it's because of the windows paths. I added this line to convert windows paths to docker compatible paths:

if ispc
    % Convert windows paths to Docker format
    imageFolder = convertPathToDockerFormat(imageFolder);
end

using this function on my path:

function dockerPath = convertPathToDockerFormat(windowsPath)
% Extract the drive letter and convert it to lowercase
driveLetter = lower(windowsPath(1));

% Remove the colon and replace backslashes with forward slashes
dockerPath = strrep(windowsPath(3:end), '\', '/');

% Prepend the drive letter in Docker's expected format
dockerPath = ['/', driveLetter, dockerPath];
end

@ningfei
Copy link
Collaborator

ningfei commented Mar 31, 2024

Thanks for reporting. Should be fixed in bf49250.

@ningfei ningfei closed this as completed Mar 31, 2024
@tfoutz99
Copy link
Author

It's still broken on Windows; brand new install using code from Git Hub. I still get the following error:

** Process done.
Segment pre-op FGATIR image...
docker found: C:\Program Files\Docker\Docker\resources\bin\docker

Pulling docker image...
invalid reference format: repository name (library/dockerImage) must be lowercase

Running THOMAS segmentation...

docker: Error response from daemon: the working directory 'Y:\XXXXXXX\sub-pt016\thomas' is invalid, it needs to be an absolute path.
See 'docker run --help'.
Warning: Escaped character '\B' is not valid. See 'doc sprintf' for supported special characters. 
> In ea_thomas (line 61)
In ea_thomas_menu (line 34)
In ea_menu_initmenu>@(~,~)ea_thomas_menu(handles) (line 47)
In matlab.ui.internal.controller/WebMenuController/fireMenuSelectedEvent (line 85)
In matlab.ui.internal.controller/WebMenuController/handleEvent (line 55)
In matlab.ui.internal.controller.WebMenuController>@(varargin)obj.handleEvent(varargin{:}) (line 36)
In viewmodel.internal.factory.ManagerFactoryProducer>@(src,event)callback(src,viewmodel.internal.factory.ManagerFactoryProducer.convertStructToEventData(event)) (line 79) 
Building atlas table...
>> 

My edits from above still fix the issue, though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants