cheba-nil / CNS

CHeBA NiL Software with UBO Detector to extract white matter hyperintensities
Other
8 stars 2 forks source link

Customize the kNN Classifier #5

Open SJ-cog opened 2 years ago

SJ-cog commented 2 years ago

Hello, I am having trouble in customizing the kNN Classifier. When I hit' rude training' I get a few error messages in Matlab (tried with 2020a, 2021a). Please see the pic attached. Any help with the issue is much appreciated. @JiyangJiang

Screen Shot 2022-05-02 at 1 15 46 AM

Here is the complete text of the line cropped in the image: Error in matlab.graphics.internal.figfile.FigFile/read>@(hObject,eventdata)CustomiseKNNclassifier_GUI('startVisualAdjustment_btn_Callback',hObject,eventdata,guidata(hObject)) Error while evaluating UIControl Callback.

Many thanks!

JiyangJiang commented 2 years ago

Hi,

Can you please provide more info, e.g., whether your data have been processed by the standard pipeline with built-in classifier, and whether you have followed the instruction (https://cns.readthedocs.io/en/latest/manual/customize_knn_classifier.html)?

Thanks, Jiyang

From: SJ-cog @.> Sent: Monday, 2 May 2022 4:28 PM To: cheba-nil/CNS @.> Cc: Jiyang Jiang @.>; Mention @.> Subject: [cheba-nil/CNS] Customize the kNN Classifier (Issue #5)

Hello, I am having trouble in customizing the kNN Classifier. When I hit' rude training' I get a few error messages in Matlab (tried with 2019a, 2021). Please see the pic attached. Any help with the issue is much appreciated. @JiyangJianghttps://github.com/JiyangJiang [Screen Shot 2022-05-02 at 1 15 46 AM]https://user-images.githubusercontent.com/68339312/166192867-f847bbdc-544d-4f68-9467-6f41edb25050.png Many thanks!

— Reply to this email directly, view it on GitHubhttps://github.com/cheba-nil/CNS/issues/5, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ANAUFPOUZOPK2XUVVFGUC3LVH5YVHANCNFSM5U3CYVWQ. You are receiving this because you were mentioned.Message ID: @.**@.>>

SJ-cog commented 2 years ago

Hi, Yes, I was able to process the data with the in built classifier without any issues. I followed the instructions listed here-(https://cns.readthedocs.io/en/latest/manual/customize_knn_classifier.html). The error is occurring at step 6, i.e. after I hit 'Rude training' or try to visually adjust the inbuilt classifier. Please let me know if I can provide any other information. Thanks, Shivangi

SJ-cog commented 2 years ago

@JiyangJiang I also tried creating a customize kNN Classifier on another Mac system and got the same error message.

JiyangJiang commented 2 years ago

Have you tried the new link I sent to you?

Jiyang

From: SJ-cog @.> Sent: Wednesday, May 4, 2022 2:49 AM To: cheba-nil/CNS @.> Cc: Jiyang Jiang @.>; Mention @.> Subject: Re: [cheba-nil/CNS] Customize the kNN Classifier (Issue #5)

@JiyangJianghttps://github.com/JiyangJiang I also tried creating a customize kNN Classifier on another Mac system and got the same error message.

— Reply to this email directly, view it on GitHubhttps://github.com/cheba-nil/CNS/issues/5#issuecomment-1116322915, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ANAUFPJEVROZJY77TSLVPKDVIFKGPANCNFSM5U3CYVWQ. You are receiving this because you were mentioned.Message ID: @.**@.>>

SJ-cog commented 2 years ago

@JiyangJiang sorry but I didn't get any link.

JiyangJiang commented 2 years ago

Can you please try this one (https://github.com/JiyangJiang/CNS)? Sorry for the confusion – it seems the one you downloaded (https://github.com/cheba-nil/CNS) is for a new development. Some function may not work properly.

Regards, Jiyang

From: SJ-cog @.> Sent: Wednesday, May 4, 2022 1:05 PM To: cheba-nil/CNS @.> Cc: Jiyang Jiang @.>; Mention @.> Subject: Re: [cheba-nil/CNS] Customize the kNN Classifier (Issue #5)

@JiyangJianghttps://github.com/JiyangJiang sorry but I didn't get any link.

— Reply to this email directly, view it on GitHubhttps://github.com/cheba-nil/CNS/issues/5#issuecomment-1116883820, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ANAUFPM7ZTCOONYPPOL4B43VIHSNPANCNFSM5U3CYVWQ. You are receiving this because you were mentioned.Message ID: @.**@.>>

SJ-cog commented 2 years ago

Thank you, I'll try it out and let you know!

SJ-cog commented 2 years ago

@JiyangJiang Still got the same error(pasted below). Do you think there is any toolbox which I need to add to make it work in addition to the three listed in the manual?

Error using CustomiseKNNclassifier_GUI>startRudeTrainingBtn_processed_Callback (line 254) Unknown error occurred.

Error in gui_mainfcn (line 95) feval(varargin{:});

Error in CustomiseKNNclassifier_GUI (line 42) gui_mainfcn(gui_State, varargin{:});

Error in matlab.graphics.internal.figfile.FigFile/read>@(hObject,eventdata)CustomiseKNNclassifier_GUI('startRudeTrainingBtn_processed_Callback',hObject,eventdata,guidata(hObject)) Error while evaluating UIControl Callback.

SJ-cog commented 2 years ago

@JiyangJiang in case this is useful- the program is creating the 'customiseClassifier' folder and four sub-folders within it (FLAIR, subjects, T1, textfiles) but they are all empty.

JiyangJiang commented 2 years ago

I just tried on some local examples, and it worked well. I think one possibility is the folder structure may be changed in the version you downloaded. The easiest solution may be reprocess your subjects with the link I sent you, and then customise classifier. You can try with a small set of examples.

Another possibility is that after you input the ‘Training size’ in set parameter section, and ‘ID’ in the Rude Training list, press enter, so that the numbers/text are received by the program.

On another note, since FSLVIEW is deprecated, you will need to do the following because the CNS was built with FSLVIEW:

cd ${FSLDIR}/bin mv fslview fslview_text ln -s fslview_deprecated fslview

let me know if this resolves the issue.

Regards, Jiyang

From: SJ-cog @.> Sent: Wednesday, May 4, 2022 1:48 PM To: cheba-nil/CNS @.> Cc: Jiyang Jiang @.>; Mention @.> Subject: Re: [cheba-nil/CNS] Customize the kNN Classifier (Issue #5)

@JiyangJianghttps://github.com/JiyangJiang in case this is useful- the program is creating the 'customiseClassifier' folder and four sub-folders within it (FLAIR, subjects, T1, textfiles) but they are all empty.

— Reply to this email directly, view it on GitHubhttps://github.com/cheba-nil/CNS/issues/5#issuecomment-1116899859, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ANAUFPILGWFNGHZQFG7RR7LVIHXO7ANCNFSM5U3CYVWQ. You are receiving this because you were mentioned.Message ID: @.**@.>>

SJ-cog commented 2 years ago

@JiyangJiang thank you for taking time to review the issue and running it on your end. I was finally able to make the custom classifier work on Matlab 2016a. Both the new CNS and old CNS pipeline works on 2016 version. It didn't work on 2019, 2020 and 2021 for me. However, now I have the problem with fslview. I tried the symbolic linking method you suggested above but its not working for me. I guess it may be because my Mac OS is 64 bit and fslview was 32 bit. In this case, is it possible to change fslview call to fsleyes in the CNS scripts? or is there any other way to make it work? Here is the error message I get when I try to visually edit the image: /Users/shijain/fsl/bin/fslview: line 7: /Users/shijain/fsl/bin/fslview.app/Contents/MacOS/fslview: Bad CPU type in executable

Thanks again for your prompt replies and suggestions! Truly appreciate them!

JiyangJiang commented 2 years ago

You can try to change ‘fslview’ to ‘fsleyes’ in the visualAdjustment_1Yes.sh and visualAdjustment_2Yes.sh in the CNS/Customise_kNN_classifier folder.

From: SJ-cog @.> Sent: Wednesday, 4 May 2022 5:16 PM To: cheba-nil/CNS @.> Cc: Jiyang Jiang @.>; Mention @.> Subject: Re: [cheba-nil/CNS] Customize the kNN Classifier (Issue #5)

@JiyangJianghttps://github.com/JiyangJiang thank you for taking time to review the issue and running it on your end. I was finally able to make the custom classifier work on Matlab 2016a. Both the new CNS and old CNS pipeline works on 2016 version. It didn't work on 2019, 2020 and 2021 for me. However, now I have the problem with fslview. I tried the symbolic linking method you suggested above but its not working for me. I guess it may be because my Mac OS is 64 bit and fslview was 32 bit. In this case, is it possible to change fslview call to fsleyes in the CNS scripts? or is there any other way to make it work? Here is the error message I get when I try to visually edit the image: /Users/shijain/fsl/bin/fslview: line 7: /Users/shijain/fsl/bin/fslview.app/Contents/MacOS/fslview: Bad CPU type in executable

Thanks again for your prompt replies and suggestions! Truly appreciate them!

— Reply to this email directly, view it on GitHubhttps://github.com/cheba-nil/CNS/issues/5#issuecomment-1116997473, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ANAUFPPFPB4BC4R6ME2BITTVIIPZ3ANCNFSM5U3CYVWQ. You are receiving this because you were mentioned.Message ID: @.**@.>>

SJ-cog commented 2 years ago

@JiyangJiang thank you for the suggestion. I think we are close to making this work. I changed fslview to fsleyes in both the visual adjustment scripts. Now this is the message that I am getting. Do I need to add anything else in the script? Is it complaining about the brightness option? Do I need to add anything other option it is displaying in the message?

---=== Welcome to CNS packages ! ===---

CNS: Setting paths ... CNS: Done. CNS: Starting customising classifier GUI ... Starting parallel pool (parpool) using the 'local' profile ... connected to 6 workers. processing sub-2201 ... sub-2201 done argument -b/--brightness: invalid float value: '0.000000,831.600220'

FSLeyes version 1.0.13

Usage: fsleyes [options] file [displayOpts] file [displayOpts] ...

Options for 'volume' overlays [-n NAME] [-d] [-a PERC] [-b PERC] [-c PERC] [-ll] [-lh] [-or LO HI] [-un] [-dr LO HI] [-cr LO HI] [-mr LO HI] [-g REAL] [-ls] [-ch {R,G,B,A}] [-ic] [-cm CMAP] [-nc CMAP] [-cmr INT] [-in {none,linear,spline}] [-inc] [-i] [-ma] [-ns INT] [-bf REAL] [-bi] [-s INT] [-r INT] [-nis INT] [-m {intersection,union,complement}] [-v INT] [-cp POS AZI INC] [-cl FILE] [-mi FILE]

SJ-cog commented 2 years ago

@JiyangJiang for the options listed along with fslview in the visual adjustment script, I replaced -b with -dr; -l with -cm . Can you tell me what -t is doing or what the equivalent FSLeyes option will be?

JiyangJiang commented 2 years ago

You can remove all options for fslview from the script. As long as you can open the FLAIR and WMH mask in FSLeyes, you can change settings (color, etc.) from the GUI.

From: SJ-cog @.> Sent: Saturday, 7 May 2022 6:42 AM To: cheba-nil/CNS @.> Cc: Jiyang Jiang @.>; Mention @.> Subject: Re: [cheba-nil/CNS] Customize the kNN Classifier (Issue #5)

@JiyangJianghttps://github.com/JiyangJiang thank you for the suggestion. I think we are close to making this work. I changed fslview to fsleyes in both the visual adjustment scripts. Now this is the message that I am getting. Do I need to add anything else in the script? Is it complaining about the brightness option? Do I need to add anything other option it is displaying in the message?

---=== Welcome to CNS packages ! ===---

CNS: Setting paths ... CNS: Done. CNS: Starting customising classifier GUI ... Starting parallel pool (parpool) using the 'local' profile ... connected to 6 workers. processing sub-2201 ... sub-2201 done argument -b/--brightness: invalid float value: '0.000000,831.600220'

FSLeyes version 1.0.13

Usage: fsleyes [options] file [displayOpts] file [displayOpts] ...

Options for 'volume' overlays [-n NAME] [-d] [-a PERC] [-b PERC] [-c PERC] [-ll] [-lh] [-or LO HI] [-un] [-dr LO HI] [-cr LO HI] [-mr LO HI] [-g REAL] [-ls] [-ch {R,G,B,A}] [-ic] [-cm CMAP] [-nc CMAP] [-cmr INT] [-in {none,linear,spline}] [-inc] [-i] [-ma] [-ns INT] [-bf REAL] [-bi] [-s INT] [-r INT] [-nis INT] [-m {intersection,union,complement}] [-v INT] [-cp POS AZI INC] [-cl FILE] [-mi FILE]

— Reply to this email directly, view it on GitHubhttps://github.com/cheba-nil/CNS/issues/5#issuecomment-1119994185, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ANAUFPKR2ZBTEUTMIMOTFBDVIV73BANCNFSM5U3CYVWQ. You are receiving this because you were mentioned.Message ID: @.**@.>>

JiyangJiang commented 1 year ago

Can you please try this one (https://github.com/JiyangJiang/CNS)? Sorry for the confusion – it seems the one you downloaded (https://github.com/cheba-nil/CNS) is for a new development. Some function may not work properly.

Regards, Jiyang

From: SJ-cog @.> Sent: Monday, 2 May 2022 5:58 PM To: cheba-nil/CNS @.> Cc: Jiyang Jiang @.>; Mention @.> Subject: Re: [cheba-nil/CNS] Customize the kNN Classifier (Issue #5)

Hi, Yes, I was able to process the data with the in built classifier without any issues. I followed the instructions listed here-(https://cns.readthedocs.io/en/latest/manual/customize_knn_classifier.html). The error is occurring at step 6, i.e. after I hit 'Rude training' or try to visually adjust the inbuilt classifier. Please let me know if I can provide any other information. Thanks, Shivangi

— Reply to this email directly, view it on GitHubhttps://github.com/cheba-nil/CNS/issues/5#issuecomment-1114592148, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ANAUFPNS3X6BHIBCXM5NFWTVH6DHPANCNFSM5U3CYVWQ. You are receiving this because you were mentioned.Message ID: @.**@.>>