Dear all. I have the image grountruth as attached. the image categorical.
Anyone know how to convert it into logical?

 Réponse acceptée

KSSV
KSSV le 27 Juin 2022
Modifié(e) : KSSV le 27 Juin 2022

0 votes

You can use ismember. Let L be your categorical data of size 128*128*64. I see that, there are two data background, tumour. You can have 0 in background and 1 in tumour, using:
idx = ismember(L,'tumor') ;

5 commentaires

mohd akmal masud
mohd akmal masud le 27 Juin 2022
Modifié(e) : KSSV le 27 Juin 2022
But I got error
Let groundTruthLabels be my categorical data of size 128*128*64
idx = ismember(groundTruthLabels,'tumor') ;
Error using cell/ismember
Input A of class cell and input B of class char must be cell arrays of character vectors,
unless one is a character vector.
KSSV
KSSV le 27 Juin 2022
Modifié(e) : KSSV le 27 Juin 2022
Load the file and use:
L = groundTruthLabels{1}{1} ;
idx = ismember(L,'tumor') ;
mohd akmal masud
mohd akmal masud le 27 Juin 2022
I tried it. But its look like empty. like below
supposedly have tumor like below
mohd akmal masud
mohd akmal masud le 27 Juin 2022
Sorry, Its Solved. Thak you sir
KSSV
KSSV le 27 Juin 2022
There is a typo error....string should be 'tumor' not 'tumour'. Edited the answer.....check it now.

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Image Processing and Computer Vision dans Centre d'aide et File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by