Skip to content

Commit

Permalink
interface for both nifti1 and nifti2 2
Browse files Browse the repository at this point in the history
  • Loading branch information
okieraised committed Nov 5, 2022
1 parent 7416838 commit 6bb388f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions nifti_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ package go2com

import (
"fmt"
"github.com/okieraised/go2com/pkg/nifti/nifti1"
"github.com/okieraised/go2com/pkg/nifti/nifti2"
"github.com/okieraised/go2com/pkg/nifti/reader"
"github.com/stretchr/testify/assert"
_ "image/jpeg"
"testing"
Expand Down Expand Up @@ -35,7 +35,7 @@ func TestNii1(t *testing.T) {
//filePath = "/home/tripg/Documents/nifti/JHU_MNI_SS_T1.nii.gz"
//filePath = "/home/tripg/Documents/nifti/avg152T1_LR_nifti2.nii.gz"

niiReader, err := nifti1.NewNii1Reader(filePath)
niiReader, err := reader.NewNiiReader(filePath)
assert.NoError(err)
err = niiReader.Parse()
assert.NoError(err)
Expand Down
2 changes: 1 addition & 1 deletion pkg/nifti/reader/nifti.go
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ func (n *Nii) getAffine() matrix.DMat44 {
func (n *Nii) getImgShape() [4]int64 {
dim := [4]int64{}

for index, _ := range n.Data.Dim {
for index, _ := range dim {
dim[index] = n.Data.Dim[index+1]
}
return dim
Expand Down
2 changes: 1 addition & 1 deletion pkg/nifti/reader/reader.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ func (r *niiReader) checkNiiVersion() error {
return errors.New("invalid NIFTI file format")
}
}
return errors.New("cannot determine NIFTI file version")
return nil
}

func (r *niiReader) MatrixToOrientation(R matrix.DMat44) {
Expand Down

0 comments on commit 6bb388f

Please sign in to comment.