how many channels does ultrasound images have?












0












$begingroup$


I have some ultrasound images, when I read them using cv.imread and check their shape or check them with ndim it shows 3 channels:



im = cv.imread(data_path+'a1.jpg')
print(im.shape)
im = np.array(im)
print(im.ndim)

the output is:
(154, 139, 3)
3


but when I open them in photoshop and check their mode in Image>Mode it shows grayscale with 8 bit, also in windows properties> detail tab shows 8 bit:
enter image description here
anyone have any idea about that?










share|improve this question











$endgroup$












  • $begingroup$
    what's the format of the image?
    $endgroup$
    – Alireza Zolanvari
    2 days ago
















0












$begingroup$


I have some ultrasound images, when I read them using cv.imread and check their shape or check them with ndim it shows 3 channels:



im = cv.imread(data_path+'a1.jpg')
print(im.shape)
im = np.array(im)
print(im.ndim)

the output is:
(154, 139, 3)
3


but when I open them in photoshop and check their mode in Image>Mode it shows grayscale with 8 bit, also in windows properties> detail tab shows 8 bit:
enter image description here
anyone have any idea about that?










share|improve this question











$endgroup$












  • $begingroup$
    what's the format of the image?
    $endgroup$
    – Alireza Zolanvari
    2 days ago














0












0








0





$begingroup$


I have some ultrasound images, when I read them using cv.imread and check their shape or check them with ndim it shows 3 channels:



im = cv.imread(data_path+'a1.jpg')
print(im.shape)
im = np.array(im)
print(im.ndim)

the output is:
(154, 139, 3)
3


but when I open them in photoshop and check their mode in Image>Mode it shows grayscale with 8 bit, also in windows properties> detail tab shows 8 bit:
enter image description here
anyone have any idea about that?










share|improve this question











$endgroup$




I have some ultrasound images, when I read them using cv.imread and check their shape or check them with ndim it shows 3 channels:



im = cv.imread(data_path+'a1.jpg')
print(im.shape)
im = np.array(im)
print(im.ndim)

the output is:
(154, 139, 3)
3


but when I open them in photoshop and check their mode in Image>Mode it shows grayscale with 8 bit, also in windows properties> detail tab shows 8 bit:
enter image description here
anyone have any idea about that?







image-preprocessing






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited yesterday









Alireza Zolanvari

19114




19114










asked 2 days ago









honar.cshonar.cs

9612




9612












  • $begingroup$
    what's the format of the image?
    $endgroup$
    – Alireza Zolanvari
    2 days ago


















  • $begingroup$
    what's the format of the image?
    $endgroup$
    – Alireza Zolanvari
    2 days ago
















$begingroup$
what's the format of the image?
$endgroup$
– Alireza Zolanvari
2 days ago




$begingroup$
what's the format of the image?
$endgroup$
– Alireza Zolanvari
2 days ago










1 Answer
1






active

oldest

votes


















1












$begingroup$

What is happening has nothing to do with the type of image (ultrasound in this case). It has to do with the type of file (JPEG in this case). By default, cv.imread assumes it is a 3-channel color image. You can specify grayscale when calling cv.imread if appropriate. The last dimension (the color dimension) in the im object could be empty.



There is also depth info (8 bits per channel). The default is 8 bit, you could specify 16 bit or 32 bit if apporiate.



Do not rely on function or software defaults. It is better to work from first principles of the raw data.






share|improve this answer









$endgroup$













  • $begingroup$
    How can I check if my image is 3 channel or 1 channel? Is there any function to do that?
    $endgroup$
    – honar.cs
    2 days ago










  • $begingroup$
    simply spoken: gray == 1 channel, everything else 3
    $endgroup$
    – Andreas Look
    yesterday










  • $begingroup$
    There is high-channel ultrasound that which can have 16, 48, 64, or 256 channels.
    $endgroup$
    – Brian Spiering
    yesterday













Your Answer





StackExchange.ifUsing("editor", function () {
return StackExchange.using("mathjaxEditing", function () {
StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix) {
StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
});
});
}, "mathjax-editing");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "557"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fdatascience.stackexchange.com%2fquestions%2f47357%2fhow-many-channels-does-ultrasound-images-have%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









1












$begingroup$

What is happening has nothing to do with the type of image (ultrasound in this case). It has to do with the type of file (JPEG in this case). By default, cv.imread assumes it is a 3-channel color image. You can specify grayscale when calling cv.imread if appropriate. The last dimension (the color dimension) in the im object could be empty.



There is also depth info (8 bits per channel). The default is 8 bit, you could specify 16 bit or 32 bit if apporiate.



Do not rely on function or software defaults. It is better to work from first principles of the raw data.






share|improve this answer









$endgroup$













  • $begingroup$
    How can I check if my image is 3 channel or 1 channel? Is there any function to do that?
    $endgroup$
    – honar.cs
    2 days ago










  • $begingroup$
    simply spoken: gray == 1 channel, everything else 3
    $endgroup$
    – Andreas Look
    yesterday










  • $begingroup$
    There is high-channel ultrasound that which can have 16, 48, 64, or 256 channels.
    $endgroup$
    – Brian Spiering
    yesterday


















1












$begingroup$

What is happening has nothing to do with the type of image (ultrasound in this case). It has to do with the type of file (JPEG in this case). By default, cv.imread assumes it is a 3-channel color image. You can specify grayscale when calling cv.imread if appropriate. The last dimension (the color dimension) in the im object could be empty.



There is also depth info (8 bits per channel). The default is 8 bit, you could specify 16 bit or 32 bit if apporiate.



Do not rely on function or software defaults. It is better to work from first principles of the raw data.






share|improve this answer









$endgroup$













  • $begingroup$
    How can I check if my image is 3 channel or 1 channel? Is there any function to do that?
    $endgroup$
    – honar.cs
    2 days ago










  • $begingroup$
    simply spoken: gray == 1 channel, everything else 3
    $endgroup$
    – Andreas Look
    yesterday










  • $begingroup$
    There is high-channel ultrasound that which can have 16, 48, 64, or 256 channels.
    $endgroup$
    – Brian Spiering
    yesterday
















1












1








1





$begingroup$

What is happening has nothing to do with the type of image (ultrasound in this case). It has to do with the type of file (JPEG in this case). By default, cv.imread assumes it is a 3-channel color image. You can specify grayscale when calling cv.imread if appropriate. The last dimension (the color dimension) in the im object could be empty.



There is also depth info (8 bits per channel). The default is 8 bit, you could specify 16 bit or 32 bit if apporiate.



Do not rely on function or software defaults. It is better to work from first principles of the raw data.






share|improve this answer









$endgroup$



What is happening has nothing to do with the type of image (ultrasound in this case). It has to do with the type of file (JPEG in this case). By default, cv.imread assumes it is a 3-channel color image. You can specify grayscale when calling cv.imread if appropriate. The last dimension (the color dimension) in the im object could be empty.



There is also depth info (8 bits per channel). The default is 8 bit, you could specify 16 bit or 32 bit if apporiate.



Do not rely on function or software defaults. It is better to work from first principles of the raw data.







share|improve this answer












share|improve this answer



share|improve this answer










answered 2 days ago









Brian SpieringBrian Spiering

4,1281029




4,1281029












  • $begingroup$
    How can I check if my image is 3 channel or 1 channel? Is there any function to do that?
    $endgroup$
    – honar.cs
    2 days ago










  • $begingroup$
    simply spoken: gray == 1 channel, everything else 3
    $endgroup$
    – Andreas Look
    yesterday










  • $begingroup$
    There is high-channel ultrasound that which can have 16, 48, 64, or 256 channels.
    $endgroup$
    – Brian Spiering
    yesterday




















  • $begingroup$
    How can I check if my image is 3 channel or 1 channel? Is there any function to do that?
    $endgroup$
    – honar.cs
    2 days ago










  • $begingroup$
    simply spoken: gray == 1 channel, everything else 3
    $endgroup$
    – Andreas Look
    yesterday










  • $begingroup$
    There is high-channel ultrasound that which can have 16, 48, 64, or 256 channels.
    $endgroup$
    – Brian Spiering
    yesterday


















$begingroup$
How can I check if my image is 3 channel or 1 channel? Is there any function to do that?
$endgroup$
– honar.cs
2 days ago




$begingroup$
How can I check if my image is 3 channel or 1 channel? Is there any function to do that?
$endgroup$
– honar.cs
2 days ago












$begingroup$
simply spoken: gray == 1 channel, everything else 3
$endgroup$
– Andreas Look
yesterday




$begingroup$
simply spoken: gray == 1 channel, everything else 3
$endgroup$
– Andreas Look
yesterday












$begingroup$
There is high-channel ultrasound that which can have 16, 48, 64, or 256 channels.
$endgroup$
– Brian Spiering
yesterday






$begingroup$
There is high-channel ultrasound that which can have 16, 48, 64, or 256 channels.
$endgroup$
– Brian Spiering
yesterday




















draft saved

draft discarded




















































Thanks for contributing an answer to Data Science Stack Exchange!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


Use MathJax to format equations. MathJax reference.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fdatascience.stackexchange.com%2fquestions%2f47357%2fhow-many-channels-does-ultrasound-images-have%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Callistus I

Tabula Rosettana

How to label and detect the document text images