Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

NF Operator class#1014

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
htwangtw wants to merge8 commits intonipy:master
base:master
Choose a base branch
Loading
fromhtwangtw:tals_dream
Open
Changes from1 commit
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
PrevPrevious commit
NextNext commit
LINT pep8
  • Loading branch information
@htwangtw
htwangtw committedJun 21, 2021
commit3f52ec2d6b38a0c84b49a2b60690c33ddde0d026
6 changes: 2 additions & 4 deletionsnibabel/arrayops.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -40,7 +40,6 @@ def _binop(self, val, *, op):
dataobj = op(self_, val_).astype(int)
return self.__class__(dataobj, affine, header)


def _unop(self, *, op):
"""
Parameters
Expand All@@ -53,7 +52,6 @@ def _unop(self, *, op):
dataobj = op(np.asanyarray(self.dataobj))
return self.__class__(dataobj, self.affine, self.header)


def __add__(self, other):
return self._binop(other, op=operator.__add__)

Expand DownExpand Up@@ -85,7 +83,6 @@ def __abs__(self):
return self._unop(op=operator.__abs__)



def _input_validation(self, val):
"""Check images orientation, affine, and shape muti-images operation."""
_type_check(self)
Expand All@@ -100,7 +97,7 @@ def _input_validation(self, val):
# Check shape.
if self.shape[:3] != val.shape[:3]:
raise ValueError("Two images should have the same shape except"
"the time dimension.")
"the time dimension.")

# if 4th dim exist in a image,
# reshape the 3d image to ensure valid projection
Expand All@@ -124,6 +121,7 @@ def _input_validation(self, val):
val_ = val
return self_, val_


def _type_check(*args):
"""Ensure image contains correct nifti data type."""
# Check types
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp