-
Notifications
You must be signed in to change notification settings - Fork 3
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
No checkerboard visible in output image #3
Comments
that's weird - did you try producing collages for them separately, and be sure that they are indeed off? |
e.g.
|
Let me try that |
I see - did you try different checker sizes, like 3 and 5 voxels etc.. Is it possible for you to share the files with me, so I can try it myself? Its perfectly fine if you can't. |
Sure ! Can I have your mail id ? |
they might be too big for email - so upload to some google drive or dropbox and send a link |
Thank you. I have sent a mail. |
Hi Lalet, I can see the differences with smaller patch sizes.. try this import os
from os.path import join as pjoin, abspath, realpath, basename, dirname, exists as pexists
from mrivis import checkerboard, color_mix, voxelwise_diff
test_dir = dirname(realpath(__file__))
base_dir = realpath(pjoin(test_dir, '..', '..', 'example_datasets'))
out_dir = realpath(pjoin(base_dir, 'centos_ver_diff'))
os.makedirs(out_dir, exist_ok=True)
c7 = pjoin(base_dir, 'T2w_acpc_centos7.nii.gz')
not_c7 = pjoin(base_dir, 'T2w_acpc.nii.gz')
im_sets = ((c7, not_c7, 'CentOS different versions'),
)
num_rows = 1
num_cols = 3
img_lim = None
rescaling='each'
patch_set = (1, 2, 3, 5, 8, 10, 25, 40)
for im_set in im_sets:
for ps in patch_set:
comb_id = 'checkerboard patch size {}'.format(ps)
out_path = pjoin(out_dir, comb_id.replace(' ', '_'))
checkerboard(im_set[0], im_set[1],
patch_size=ps,
rescale_method=rescaling,
num_rows=num_rows,
num_cols=num_cols,
annot=comb_id,
output_path=out_path) Perhaps the rescale method is making a difference.. need to check. |
change the base_dir to where the images are. |
and num_rows = 2
num_cols = 5
img_lim = None # [0, 4000]
rescaling='each'
for im_set in im_sets:
comb_id = 'voxelwise_diff'
out_path = pjoin(out_dir, comb_id.replace(' ', '_'))
voxelwise_diff(im_set[0], im_set[1],
rescale_method=rescaling,
overlay_image=True,
overlay_alpha=0.7,
background_threshold=25,
num_rows=num_rows,
num_cols=num_cols,
annot=comb_id,
output_path=out_path) |
Yes yes ! This is awesome. Thank you @raamana |
Hi @glatard, can you take a look at this thread, and let me know your comments? I just want to make sure I fix the bug in my checkerboard implementation if it exists. |
Description
from mrivis import checkerboard
plot = checkerboard('T2w_acpc.nii.gz','T2w_acpc_centos7.nii.gz',patch_size=10)
plot.savefig("T2w_tilt.png")
@glatard
The text was updated successfully, but these errors were encountered: