Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8734419
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T09:50:16+00:00 2026-06-13T09:50:16+00:00

I am not an experienced programmer, just need to add a DICOM viewer to

  • 0

I am not an experienced programmer, just need to add a DICOM viewer to my VS2010 project. I can display the image in Windows Forms, however can’t figure out how to change the window center and width. Here is my script:

DicomImage image = new DicomImage(_filename);
            int maxV = image.NumberOfFrames;
            sbSlice.Maximum = maxV - 1;
            image.WindowCenter = 7.0;
            double wc = image.WindowCenter;
            double ww = image.WindowWidth;

            Image result = image.RenderImage(0);
            DisplayImage(result);

It did not work. I don’t know if this is the right approach.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T09:50:17+00:00Added an answer on June 13, 2026 at 9:50 am

    I looked at the code and it looked extremely buggy. https://github.com/rcd/fo-dicom/blob/master/DICOM/Imaging/DicomImage.cs

    In the current buggy implementation setting the WindowCenter or WindowWidth properties has no effect unless Dataset.Get(DicomTag.PhotometricInterpretation) is either Monochrome1 or Monochrome2 during Load(). This is already ridiculous, but it still cannot be used because the _renderOptions variable is only set in a single place and is immediately used for the _pipeline creation (not giving you chance to change it using the WindowCenter property). Your only chance is the grayscale _renderOptions initialization: _renderOptions = GrayscaleRenderOptions.FromDataset(Dataset);.

    The current solution: Your dataset should have

    • DicomTag.WindowCenter set appropriately
    • DicomTag.WindowWidth != 0.0
    • DicomTag.PhotometricInterpretation == Monochrome1 or Monochrome2

    The following code accomplishes that:

    DicomDataset dataset = DicomFile.Open(fileName).Dataset;
    //dataset.Set(DicomTag.WindowWidth, 200.0); //the WindowWidth must be non-zero
    dataset.Add(DicomTag.WindowCenter, "100.0");
    //dataset.Add(DicomTag.PhotometricInterpretation, "MONOCHROME1"); //ValueRepresentations tag is broken
    dataset.Add(new DicomCodeString(DicomTag.PhotometricInterpretation, "MONOCHROME1"));
    DicomImage image = new DicomImage(dataset);
    image.RenderImage();
    

    The best solution: Wait while this buggy library is fixed.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am not a Fortran programmer (just a short experience), but I need to
I am not an experinced c++ programmer. So I just want to know how
I'm not an experienced C++ programmer and I'm having problems compiling. I've got a
I am not a very experienced C++ programmer, i get a warning when i
Apologies if this doesn't make sense, i'm not much of an experienced programmer. Consider
Hei there, I'm not experienced at all in C++ as I need to start
I'm not the worlds most experienced Java programmer, and I'm trying to create a
I'm an experienced C++/.NET/Java Windows/web programmer trying to learn (Common) Lisp. I'm reading Practical
Note: I'm a experienced C++ programmer, so I don't need any pointer basics. It's
Let me begin by saying I am not an extremely experienced programmer and would

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.