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

next release v1.1.0 beta #13

Merged
merged 10 commits into from
Jan 10, 2022
Merged
Show file tree
Hide file tree
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
2 changes: 2 additions & 0 deletions .github/workflows/comment-bot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ jobs:
post({
owner: context.repo.owner, repo: context.repo.repo,
comment_id: context.payload.comment.id, content: "eyes"})
github-token: ${{ secrets.GH_TOKEN }}
- name: Tag Commit
run: |
git clone https://${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY} repo
Expand All @@ -48,3 +49,4 @@ jobs:
post({
owner: context.repo.owner, repo: context.repo.repo,
comment_id: context.payload.comment.id, content: "rocket"})
github-token: ${{ secrets.GH_TOKEN }}
44 changes: 13 additions & 31 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,6 @@ jobs:
- if: startsWith(matrix.python, '2')
run: pytest
- run: codecov
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
matlab:
if: github.event_name != 'pull_request' || github.head_ref != 'devel'
runs-on: [self-hosted, python, matlab]
Expand All @@ -72,8 +70,6 @@ jobs:
- run: pip install -U .[dev]
- run: pytest --durations-min=1
- run: codecov
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
- name: Post Run setup-python
run: setup-python -p3.7 -Dr
if: ${{ always() }}
Expand All @@ -89,37 +85,23 @@ jobs:
- id: dist
uses: casperdcl/deploy-pypi@v2
with:
build: true
pip: true
gpg_key: ${{ secrets.GPG_KEY }}
password: ${{ secrets.PYPI_TOKEN }}
upload: ${{ github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags') }}
- name: Changelog
run: git log --pretty='format:%d%n- %s%n%b---' $(git tag --sort=v:refname | tail -n2 | head -n1)..HEAD > _CHANGES.md
- if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
id: create_release
uses: actions/create-release@v1
upload: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags') }}
- id: meta
name: Changelog
run: |
echo ::set-output name=tag::${GITHUB_REF#refs/tags/}
git log --pretty='format:%d%n- %s%n%b---' $(git tag --sort=v:refname | tail -n2 | head -n1)..HEAD > _CHANGES.md
- if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: spm12 ${{ github.ref }} beta
name: spm12 ${{ steps.meta.outputs.tag }} beta
body_path: _CHANGES.md
draft: true
- if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: dist/${{ steps.dist.outputs.whl }}
asset_name: ${{ steps.dist.outputs.whl }}
asset_content_type: application/zip
- if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: dist/${{ steps.dist.outputs.whl_asc }}
asset_name: ${{ steps.dist.outputs.whl_asc }}
asset_content_type: text/plain
files: |
dist/${{ steps.dist.outputs.whl }}
dist/${{ steps.dist.outputs.whl_asc }}
9 changes: 5 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ default_language_version:
python: python3
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.4.0
rev: v4.0.1
hooks:
- id: check-added-large-files
- id: check-case-conflict
Expand All @@ -26,19 +26,20 @@ repos:
exclude: ^(.pre-commit-config.yaml|.github/workflows/test.yml)$
args: [-i]
- repo: https://gitlab.com/pycqa/flake8
rev: 3.8.4
rev: 3.9.2
hooks:
- id: flake8
args: [-j8]
additional_dependencies:
- flake8-bugbear
- flake8-comprehensions
- flake8-debugger
- flake8-string-format
- repo: https://github.com/psf/black
rev: 19.10b0
rev: 21.7b0
hooks:
- id: black
- repo: https://github.com/PyCQA/isort
rev: 5.7.0
rev: 5.9.3
hooks:
- id: isort
2 changes: 2 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ demo=
[options.entry_points]
console_scripts =
spm12=spm12.cli:main
[options.packages.find]
exclude=tests
[options.package_data]
*=*.md, *.rst, *.m

Expand Down
2 changes: 1 addition & 1 deletion spm12/coreg_spm_m.m → spm12/amypad_coreg.m
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
function [M, x] = coreg_spm_m(imref, imflo, costfun, sep, tol, fwhm, params, graphics, visual)
function [M, x] = amypad_coreg(imref, imflo, costfun, sep, tol, fwhm, params, graphics, visual)
if visual>0
Fgraph = spm_figure('GetWin','Graphics');
Finter = spm_figure('GetWin','Interactive');
Expand Down
7 changes: 7 additions & 0 deletions spm12/amypad_coreg_modify_affine.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
function out = amypad_coreg_modify_affine(imflo, M)
VF = strcat(imflo,',1');
MM = zeros(4,4);
MM(:,:) = spm_get_space(VF);
spm_get_space(VF, M\MM(:,:));
out = 0;
end
10 changes: 10 additions & 0 deletions spm12/amypad_normw.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
function out = amypad_normw(def_file, flist4norm)
job.subj.def = {def_file};
job.subj.resample = flist4norm;
job.woptions.bb = [NaN, NaN, NaN; NaN, NaN, NaN];
job.woptions.vox = [2, 2, 2];
job.woptions.interp = 4;
job.woptions.prefix = 'w';
spm_run_norm(job);
out=0;
end
2 changes: 1 addition & 1 deletion spm12/resample_spm_m.m → spm12/amypad_resample.m
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
function out = resample_spm_m(imref, imflo, M, f_mask, f_mean, f_interp, f_which, f_prefix)
function out = amypad_resample(imref, imflo, M, f_mask, f_mean, f_interp, f_which, f_prefix)
%-Reslicing parameters
rflags.mask = f_mask;
rflags.mean = f_mean;
Expand Down
46 changes: 46 additions & 0 deletions spm12/amypad_seg.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
function [param,invdef,fordef] = amypad_seg(f_mri, spm_path, nat_gm, nat_wm, nat_csf, store_fwd, store_inv, visual)
job.channel.vols = {strcat(f_mri,',1')};
job.channel.biasreg = 0.001;
job.channel.biasfwhm = 60;
job.channel.write = [0, 0];
job.tissue(1).tpm = {[spm_path, filesep, 'tpm', filesep, 'TPM.nii,1']};
job.tissue(1).ngaus = 1;
job.tissue(1).native = [nat_gm, 0];
job.tissue(1).warped = [0, 0];
job.tissue(2).tpm = {[spm_path, filesep, 'tpm', filesep, 'TPM.nii,2']};
job.tissue(2).ngaus = 1;
job.tissue(2).native = [nat_wm, 0];
job.tissue(2).warped = [0, 0];
job.tissue(3).tpm = {[spm_path, filesep, 'tpm', filesep, 'TPM.nii,3']};
job.tissue(3).ngaus = 2;
job.tissue(3).native = [nat_csf, 0];
job.tissue(3).warped = [0, 0];
job.tissue(4).tpm = {[spm_path, filesep, 'tpm', filesep, 'TPM.nii,4']};
job.tissue(4).ngaus = 3;
job.tissue(4).native = [0, 0];
job.tissue(4).warped = [0, 0];
job.tissue(5).tpm = {[spm_path, filesep, 'tpm', filesep, 'TPM.nii,5']};
job.tissue(5).ngaus = 4;
job.tissue(5).native = [0, 0];
job.tissue(5).warped = [0, 0];
job.tissue(6).tpm = {[spm_path, filesep, 'tpm', filesep, 'TPM.nii,6']};
job.tissue(6).ngaus = 2;
job.tissue(6).native = [0, 0];
job.tissue(6).warped = [0, 0];
job.warp.mrf = 1;
job.warp.cleanup = 1;
job.warp.reg = [0, 0.001, 0.5, 0.05, 0.2];
job.warp.affreg = 'mni';
job.warp.fwhm = 0;
job.warp.samp = 3;
job.warp.write = [store_fwd, store_inv];
if visual>0
Finter = spm_figure('GetWin','Interactive');
end
spm_jobman('initcfg');
segout = spm_preproc_run(job);
param = segout.param{1};
invdef = segout.invdef{1};
fordef = segout.fordef{1};
%disp(segout);
end
Loading