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

PHysIO #180 #166: Removing fieldtrip paths instead of spm #181

Open
wants to merge 6 commits into
base: development
Choose a base branch
from

Conversation

nbeliy
Copy link

@nbeliy nbeliy commented Apr 11, 2022

Hi,
I was looking into bypassing issues #180 and #166,
and found that PhysIO already tries to remove sub-directories of spm, but, probably due to outdated version it doesn't work on my installation (my FirledTrip don't have ft_check_path).

In this pull request, I replace ft_check_path by ft_defaults, which is setting paths function,which exists since 2010, and
I remove paths related to all installations of fieldtrip:

oldPath = path();

pathThis = fileparts(mfilename('fullpath'));
ft_paths = which('ft_defaults', '-all')

try
for p = 1:size(ft_paths, 1)
    to_remove = fileparts(ft_paths{p});
    warning('off', 'MATLAB:rmpath:DirNotFound')
    rmpath(genpath(to_remove));
    warning('on', 'MATLAB:rmpath:DirNotFound')
end
ft_paths = which('ft_defaults', '-all')

After execution, the original paths are restored.

Alternative, is to remove all paths, using restoredefaultpaths, to inshure that PhysIO will run only on bare matlab.

I also added an otherwise with error in switch for the list of vendors.

Copy link
Member

@mrikasper mrikasper left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dear Nikita,

Thank you for suggesting these changes. I made two comments to your implementation, hope you can see them.

Furthermore, could you please also add a version of the Contributor License Agreement file to this pull request that has a table row with your name and info inserted. I have explained the rationale for that here and here.

You might want to wait a few days with that (so that you don't have to do it twice), because we're just in the process of finalizing a release, and it's probably easier to start from the new version.

All the best, and looking forward to your changes,
Lars

PhysIO/code/readin/tapas_physio_read_physlogfiles.m Outdated Show resolved Hide resolved
PhysIO/code/tapas_physio_main_create_regressors.m Outdated Show resolved Hide resolved
@nbeliy
Copy link
Author

nbeliy commented Apr 11, 2022

It's not urgent, tell me when it could be merged.
I left in he code some print-outs, I will obviously remove them.

@nbeliy nbeliy marked this pull request as ready for review May 3, 2022 12:34
@nbeliy
Copy link
Author

nbeliy commented May 3, 2022

Hi Lars, as requested a ping after the new release)

In current version, the fieldtrip paths are removed with message:

Warning: Removing FieldTrip paths (https://github.com/translationalneuromodeling/tapas/issues/166)
	/home/beliy/Documents/MATLAB/Add-Ons/spm/SPM12/external/fieldtrip

You can restore FieldTrip path using:
	addpath('/home/beliy/Documents/MATLAB/Add-Ons/spm/SPM12/external/fieldtrip');
	ft_defaults;

Second message appears only with verbosity >= 3.

About the reported conflict, the only revelant part of conflict is addpath:

% Include subfolders of code to path as well
pathThis = fileparts(mfilename('fullpath'));
addpath(genpath(pathThis)); 

For me it should be done during installation of PhysIO, and crosschecked in tapas_physio_init.m
But if you find it necessary, I can restore it.
The spm check are replaced by fieldtrip checks.

And the matlabbatch check is not important: if tapas_main is called via matlabbatch, then PhysIO is integrated into spm.
If main is called not via matlabbatch, then the check is not useful.

For me, the full tapas_physio_check_spm.m becomes obsolete.

Tell me, further modifications are required.

@mrikasper
Copy link
Member

Dear Nikita,

My apologies, but I didn't have time to include your PR into the upcoming TAPAS release. I am working with a student on a summer project to improve PhysIO, but it will take a couple of weeks to overhaul everything. I will let you know, once we integrate your PR.

All the best,
Lars

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.

None yet

2 participants