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

fix bilateral bugs #3

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
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
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,4 @@ See the following script for instructions:

Isaiah Norton, Walid Ibn Essayed, Fan Zhang, Sonia Pujol, Alex Yarmarkovich, Alexandra J. Golby, Gordon Kindlmann, Demian Wassermann, Raul San Jose Estepar, Yogesh Rathi, Steve Pieper, Ron Kikinis, Hans J. Johnson, Carl-Fredrik Westin and Lauren J. O'Donnell.
SlicerDMRI: Open Source Diffusion MRI Software for Brain Cancer Research. Cancer Research 77(21), e101-e103, 2017.

6 changes: 3 additions & 3 deletions src/tract_feat.py
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,7 @@ def bilateralize_feature_OLD(y_names, y_data, x_data, fliped_copy=False):

# Replace y label of right structure to its corresponding left structure
# Note: here we assume that right structure is next to the left structure
y_data_bilateral_ = y_data
y_data_bilateral_ = np.copy(y_data)
for y_label in all_y_labels:
if 'left' in y_names[y_label]:
# print y_label, y_names[y_label], y_names[y_label+1]
Expand All @@ -480,7 +480,7 @@ def bilateralize_feature_OLD(y_names, y_data, x_data, fliped_copy=False):
y_names_bilateral = np.array(y_names_bilateral)

# Make bilateral x data
x_data_reflected = x_data
x_data_reflected = np.copy(x_data)
x_data_reflected[:,:,:,0] = -x_data_reflected[:,:,:,0]

x_data_bilateral = np.concatenate((x_data, x_data_reflected), axis=2)
Expand Down Expand Up @@ -649,7 +649,7 @@ def bilateralize_feature(y_data, y_names, y_validation=None, verbose=False):

def bilateral_X_data(x_data, fliped_copy=False, y_data=None):

x_data_reflected = x_data
x_data_reflected = np.copy(x_data)
x_data_reflected[:,:,:,0] = -x_data_reflected[:,:,:,0]

if x_data_reflected.shape[-1] == 4:
Expand Down