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

Why is that n_components of PCA in def get_matched_tissue is 4? #25

Open
gmh1033286494 opened this issue Jan 12, 2021 · 9 comments
Open

Comments

@gmh1033286494
Copy link

I run with no_segement_analysis = False and get this error

ValueError: n_components=4 must be between 0 and min(n_samples, n_features)=2 with svd_solver='full'

So I set n_components = 2 and the code worked but the result is only half of the image.

I am wondering why this happens.
image

@jlevy44
Copy link
Owner

jlevy44 commented Jan 12, 2021

Hi @gmh1033286494 , you may be running an older version of mixmatch, you may want to pip install the code in this branch, though it is experimental: https://github.com/jlevy44/PathFlow-MixMatch/tree/fix_nonlinear_memory_issues

We are still refactoring, but let me know if you still get the pca issue, shouldn't be running. Also check for typos in your command specification.

@gmh1033286494
Copy link
Author

test = Commands()

test.register_images(im1 = '/home/chixing/fixed_im_grey_r16.png',im2 = '/home/chixing/moving_im_grey_r16.png',fix_rotation = False,output_dir='/home/chixing/result/',gpu_device = 0,transform_type = 'rigid',lr = 0.01,iterations = 10,min_object_size = 500,no_segment_analysis = False,black_background = True
)

I still get the same PCA error using the 'fix_nonlinear_memory_issues' version. Above is what I used in the my command specification.

BTW, how to pip install this branch?

pip install git+https://github.com/jlevy44/PathFlow-MixMatch.git
This seems to only install the code in the master.
So instead I copy the code in cli.py into a jupyter notebook and run it.

@sumanthratna
Copy link
Collaborator

BTW, how to pip install this branch?

@gmh1033286494 I think this should work: pip install "git+https://github.com/jlevy44/PathFlow-MixMatch.git@fix_nonlinear_memory_issues#egg=pathflow_mixmatch"

@gmh1033286494
Copy link
Author

BTW, how to pip install this branch?

@gmh1033286494 I think this should work: pip install "git+https://github.com/jlevy44/PathFlow-MixMatch.git@fix_nonlinear_memory_issues#egg=pathflow_mixmatch"

It worked but still got the same PCA error. I am using dapi channel of 2 4000*5000 sequently sliced mIHC grey scale images as fixed and moving image. Format is png.

@jlevy44
Copy link
Owner

jlevy44 commented Jan 15, 2021

Can you try setting no_segment_analysis = True ?

@gmh1033286494
Copy link
Author

gmh1033286494 commented Jan 18, 2021

Can you try setting no_segment_analysis = True ?

It is working when no_segment_analysis = True. But I am thinking whether with segment_analysis the result will be better and the speed will be faster. Besides when no_segment_analysis = True, my GPU can only support image as largest as 5000 7000,I wondering if with segment_analysis I can use larger fixed and moving image. If I remembered correct you mention mixmatch could support about 50000 50000 wsi.

Thank you.

@jlevy44
Copy link
Owner

jlevy44 commented Jan 18, 2021

With segment analysis, it assumes that your image can be broken into various smaller connected components, is this true in your case?

@gmh1033286494
Copy link
Author

With segment analysis, it assumes that your image can be broken into various smaller connected components, is this true in your case?

I don't know if my test image can be broken into various smaller connected components(probably not). Could you give me some examples or test images?

@jlevy44
Copy link
Owner

jlevy44 commented Feb 23, 2021

if the image is the one you had sent in #26 , I'm not sure the segmented analysis is applicable.. you need to have clear separation of the components. In histology, this may be applicable for an FNA biopsy. In the future, we do plan to have some pre-clustering algorithm to find corresponding clusters of segments to register, but is not currently a priority

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants