Skip to content

Commit

Permalink
Merge pull request #3 from dvm-shlee/main
Browse files Browse the repository at this point in the history
quick patch
  • Loading branch information
dvm-shlee authored May 1, 2024
2 parents 1311811 + c14548f commit 80fe2aa
Show file tree
Hide file tree
Showing 7 changed files with 78 additions and 32 deletions.
11 changes: 4 additions & 7 deletions plugin/bids/manifest.yaml
Original file line number Diff line number Diff line change
@@ -1,23 +1,20 @@
name: bids

type: plugin
subtype: tonifti
version: 0.0.1
source: bids.py::Bids

authors:
- Sung-Ho Lee ([email protected])

license: MIT
description: "BIDS plugin for tonifti app"
documentation: "README.md"
citation: CITATION.cff

app:
target: tonifti
src: bids.py::Bids

dependencies:
- numpy>=1.18

script:
argparser:
name: bids
help: plugin function for converting file based on various BIDS specification
arguments:
Expand Down
19 changes: 8 additions & 11 deletions plugin/myplugin/manifest.yaml
Original file line number Diff line number Diff line change
@@ -1,28 +1,25 @@
name: myplugin

type: plugin
subtype: tonifti
version: 0.0.1
source: myplugin.py::MyPlugIn

authors:
- Sung-Ho Lee ([email protected])

license: YourLicense
- MyName ([email protected])
license: MyLicense
description: "My plugin."
documentation: "README.md"
citation: CITATION.cff

app:
target: tonifti
src: myplugin.py::MyPlugIn

dependencies:
- numpy>=1.18

script:
argparser:
name: myplugin
help: plugin function for SORDINO-MRI reconstruction
help: plugin function to multiply dataobj by 2
arguments:
- name: "--option"
help: "Option for command line integration."
help: "Option to activate multiplying dataobj by 2."
action: "store_true"
default: false

14 changes: 7 additions & 7 deletions plugin/myplugin/myplugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,9 @@ def get_dataobj(self, reco_id: Optional[int] = None) -> NDArray:
dataobj *= 2
return dataobj

def get_affine(self, reco_id:Optional[int]=None,
subj_type:Optional[str]=None,
subj_position:Optional[str]=None) -> NDArray:
def get_affine(self, reco_id: Optional[int] = None,
subj_type: Optional[str] = None,
subj_position: Optional[str] = None) -> NDArray:
"""Retrieve the affine transformation matrix.
Args:
Expand All @@ -121,10 +121,10 @@ def get_affine(self, reco_id:Optional[int]=None,
Returns:
NDArray: Affine transformation matrix.
"""
return super().get_affine(scanobj=self,
reco_id=reco_id,
subj_type=subj_type,
subj_position=subj_position)
return super().get_affine(scanobj = self,
reco_id = reco_id,
subj_type = subj_type,
subj_position = subj_position)

def get_nifti1header(self) -> Nifti1Header:
"""Retrieve the NIfTI header updated as necessary for this plugin.
Expand Down
10 changes: 3 additions & 7 deletions plugin/sordino/manifest.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
name: sordino
type: plugin

subtype: tonifti
version: 24.4.27
source: sordino.py::Sordino

authors:
- Sung-Ho Lee ([email protected])
Expand All @@ -13,17 +14,12 @@ license: MIT
description: "This plugin converts SORDINO-MRI (acquired in radial trajectory) to NIfTI format."
documentation: "README.md"
citation: CITATION.cff

app:
target: tonifti
src: sordino.py::Sordino

dependencies:
- numpy>=1.18
- scipy>=1.11.1
- sigpy>=0.1.26

script:
argparser:
name: sordino
help: plugin function for SORDINO-MRI reconstruction
arguments:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
name: bids_v1.2.2_brkraw
type: recipe
subtype: bids-file_metadata
startup:
- 'import numpy as np'

Expand Down
50 changes: 50 additions & 0 deletions recipe/recipe_studyinfo_v0.0.1_brkraw.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: studyinfo_v0.0.1_brkraw
type: recipe
subtype: studyinfo
startup:
-

study:
date:
- header.study_date
- header.date
dob: header.dbirth
id: header.id
name: header.name_string
operator: study_operator
position:
- header.study_instrument_position
- entry: header.entry
position: header.position
script: entry.split("_").pop(-1) + "_" + position.split("_").pop(-1)
sex:
- header.gender
- header.sex
study_name: header.study_name
study_nr: header.study_nr
sw_version: header.sw_version
type: header.type
weight:
- header.study_weight
- header.weight

scan:
dim: image.dim
in_plane_shape: image.shape
in_plann_resolution: image.resolution
method: protocol.scan_method
num_cycles: cycle.num_cycles
num_slice_packs: slicepack.num_slice_packs
num_slices_each_pack: slicepack.num_slices_each_pack
ppg: protocol.pulse_program
protocol: protocol.protocol_name
slice_distances_each_pack: slicepack.slice_distances_each_pack
slice_order_scheme: slicepack.slice_order_scheme
time_step: cycle.time_step

reco:
dim_description:
dim_desc: image.dim_desc
fg_desc: frame_group.id
script: dim_desc + [f.split("_")[-1].lower() for f in fg_desc]
type: frame_group.type
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
name: bids_v1.2.2_brkraw
type: bids-spec
subtype: converter
brkraw:
path:
type: string
Expand Down

0 comments on commit 80fe2aa

Please sign in to comment.