|
Actually RAW format is still the DICOM image which i open up to view using Adobe Photoshop. The only difference is all the headers has benn remove what i am left with is just the image itself. My problem now is how do i view the pixel values from Photoshop? The image is in the grey.Does MATLAB be of any help?
|
|
|
|
|
So you have a byte *, right ? And it's still a DICOM image, so it's 10 bits per pixel, right ? I assume DICOM does not waste any bits, that the 11th bit is the first bit of the next pixel ? Does it also flow on between rows that way ? Does it store the rows top down, or bottom up ?
If you have a byte * and you need to work out how to get at each pixel, then I doubt MATLAB will help much, what you need to do is work out the internal format exactly so you know how to get to the 2 ( or maybe 3 ) bytes you need, and then mask those bytes and shift thier values to get the final result.
I am on the edge of doing some work with DICOM, which is why I believe they are 10 bit, but I don't know enough about the format to comment beyond that. Do you have any resources about what a RAW DICOM file actually looks like internally ?
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
By the way, I am not the moron who voted this a 2.0.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Sorry i don't get what you mean by voted this as 2.0.Anyway i hope you are able to help.Thanks.
|
|
|
|
|
What if I save the DICOM image as a text file? Will I be able to convert the text file to binary? If so how should I go about writing the program? Can debugging help?Or perhaps using the basic "printf" function to display teh pixels values if I know where the values are store. PLease advise.Thks.
|
|
|
|
|
I'm working on an app that allows the user to burn CD's, but if the user hasn't previously set up an action for the CD Drive's property for action on a blank CD, the "What do you want Windows to do?" window pops up. This message needs to be supressed of course.
I have a working version of code, initially based off of a "service" article on MSDN (sorry don't have the link), that basically just enumerates all desktop windows to find the title of the window, then enumerates the children of that window to find the "What do you want Windows to do?" message. Once it finds all this, then it closes the window. It does this enumeration every 1/4 second in a background thread, but only when needed (just when prompting the user for a disc) to minimize CPU impact. The window will flash up, but will be gone before the user knows what hit them. This can probably be done better using hooks, but I'm not quite there yet -- and what I've found so far makes me think they won't work much better overall (see the next paragraph).
Anyway, the problem I'm having is that although this works, the application needs to be localized into around 8 different languages (possibly more, can't remember exactly off-hand), so looking for strings to go off of won't work very well, not to mention this code will break as soon as windows decides to change the text. Using normal hooking methods don't look any more promising for this, because I still need some way to figure out that it's the correct window being created.
I'm thinking there's gotta be something simple I'm missing here. Any ideas?
-----
In the land of the blind, the one eyed man is king.
|
|
|
|
|
Hello,
this[^] should point you in the right direction.
Behind every great black man...
... is the police. - Conspiracy brother
Blog[^]
|
|
|
|
|
I bet that will work, but the following disclaimer has me a little worried: "Applications should not modify these values, as there is no way to reliably restore them to their original values."
I don't see why there should be any problem restoring to the original settings though.
-----
In the land of the blind, the one eyed man is king.
|
|
|
|
|
Ah, even better ... found exactly what I needed on MSDN after checking out that article (and knowing what to search for ... that is half the battle with MSDN) Enabling and Disabling AutoRun[^]
Thanks a bunch!
-----
In the land of the blind, the one eyed man is king.
|
|
|
|
|
You're welcome
Behind every great black man...
... is the police. - Conspiracy brother
Blog[^]
|
|
|
|
|
Vineas wrote:
I don't see why there should be any problem restoring to the original settings though.
A user might change these settings themselves in the control panel or something. If you save the old value, it might not be up-to-data. Therefore if you restore those values, the user might lose their own settings...
I wouldn't worry about that too much, since no user is going to change it every day and uninstall your software right after the change.
You might list this "feature" as a known bug or something.
Behind every great black man...
... is the police. - Conspiracy brother
Blog[^]
|
|
|
|
|
Yeah, as long as ANOTHER program does not change them to something else in the meantime. That is ALWAYS the problem. Then, by definition, you are not 'restoring' the original settings, whatever you write back.
|
|
|
|
|
Turns out I didn't need to use the registry value anyway, the article at the link I put in earlier had a message that is sent to the top level window just before auto play is enacted. I ended up hooking this in a background thread whenever the CD burning dialogs are up, worked really well and didn't have to worry about messing up registry or a blocking AfxMessageBox call (one of the big problems I had once I figured out the message I needed to handle).
Thanks again for all the help, the code project has been a constant source of help and inspiration.
-----
In the land of the blind, the one eyed man is king.
|
|
|
|
|
Hi,
I'm currently writing a screensaver. I do not use the scrnsave.h template.
In order to open the configuration window properly I need to open my configuration dialog with a command line provided window handle as its parent. Unfortunately I cant provide a window handle to my dialogs constructor since it expects a CWnd derived object and I cannot create a CWnd object directly. How do I change the Dialog parent window handle?
Currently I open the dialog with:
CWatorSaverDlg dlg;
m_pMainWnd = &dlg;
What do I have to change?
Regards,
Ingo
|
|
|
|
|
You can instantiate a CWnd object.
Then use the Attach member to attach it to the HWND you have.
Use this CWnd as the parent for the dialog.
When the dialog is done, detach the CWnd from the HWND.
Then delete the CWnd.
CWnd* pTempParent = NULL;
pTempParent = new CWnd();
pTempParent->Attach(PassedHWnd);
...
CWatorSaverDlg dlg(pTempParent);
...
pTempParent->Detach();
delete pTempParent;
|
|
|
|
|
Hi,
Here's the problem: I wrote a chat program in which each user has a different color. Unfortunately, I don't know how to get these different colors to appear in the editbox I'm using for the main chat window.
How do I color a certain portion of text in an editbox to be different from other portions of text?
Thanks!
|
|
|
|
|
Use a rich edit control. See CRichEditCtrl::SetSelectionCharFormat().
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" mYkel - 21 Jun '04
Within you lies the power for good - Use it! Honoured as one of The Most Helpful Members of 2004
|
|
|
|
|
I have a problem kinda similar to this:
I create a CRichEditCtrl using CreateEx, like this:
chat_window_rich.CreateEx(0, "Edit","", WS_TABSTOP | WS_CHILD | WS_VISIBLE | ES_MULTILINE | ES_AUTOVSCROLL |
ES_READONLY | WS_VSCROLL, W_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, hwnd, (HMENU)CHAT_WINDOW,NULL);
Then I try to set the text color using this:
CHARFORMAT cf;
::memset( &cf, 0, sizeof( cf ) );
cf.cbSize = sizeof( cf );
cf.dwMask = CFM_COLOR;
cf.crTextColor = RGB( 255, 160, 160 );
int test = SendMessage(chat_window_rich.GetSafeHwnd(), EM_SETCHARFORMAT, (WPARAM) SCF_ALL, (LPARAM) &cf );
But the SendMessage always fails, and the text isn't set. ??? Does anyone know what might be wrong?
Kelly Ryan
|
|
|
|
|
KellyR wrote:
chat_window_rich.CreateEx(0, "Edit",
If chat_window_rich is a CRichEditCtrl type why not use CRichEditCtrl::Create() instead of CWnd::CreateEx() as you are not specifying any extended styles? If you must use the form you are using then you have to specify the proper classname. You can use the macro RICHEDIT_CLASS or failing that the possible class names are "RichEdit", "RichEdit20A", or "RichEdit20W".
Right now, because you specified "Edit" as the class name you are creating a plain old edit control, not a rich edit control, that does not know what the EM_SETCHARFORMAT message is.
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" mYkel - 21 Jun '04
Within you lies the power for good - Use it! Honoured as one of The Most Helpful Members of 2004
|
|
|
|
|
YES!!!! IT WORKS!!!!
Thank you so much!!! I've been trying to get this damn thing to work for like 4 hours!
WOOHOOO
Kelly Ryan
|
|
|
|
|
You can have it as owner drawn and override WM_DRAWITEM, This would allow you to put the text in a way that you need.
<bold>- Nilesh
<italics>
"Reading made Don Quixote a gentleman. Believing what he read made him mad" -George Bernard Shaw
|
|
|
|
|
Nilesh K. wrote:
You can have it as owner drawn and override WM_DRAWITEM
You have done this with an edit control? I always thought WM_DRAWITEM was only for menus, buttons, and list and combo boxes.
Learn something new every day.
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" mYkel - 21 Jun '04
Within you lies the power for good - Use it! Honoured as one of The Most Helpful Members of 2004
|
|
|
|
|
I am trying to place a dialog directly on top of a window from another app.
I am trying to cope with some z-order issues. Of trying to get my little dialog to appear directly on top of another app's window.
The x-y position issues are just fine -- for testing I put my window at top-most and it looks great as long as the other app is #2.
Alternately, I'd be looking for a strategy to decide when the appropriate time is to hide my window... like when the region where'd i'd display myself is obscured.
Basically, it has to look as much like a built-in as possible.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br />
Peter Weyzen<br />
Staff Engineer<br />
<A HREF="http://www.santacruznetworks.com">Santa Cruz Networks</A>
|
|
|
|
|
First use BringWindowToTop() to being the other application's window to the top. Then use SetWindowPos(hWnd, HWND_TOP, ...) to put your app's window right in front of the other.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
What will happen if I want to create a Socket giving it the IP of the machine where my program is not running. Will it be allowed or be nor allowed due to security. Actually, I want to communicate between two machine through Sockets .... but one machine runs on LAN and other is connected to Internet through direct modem ...
|
|
|
|