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 8433511
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T06:24:21+00:00 2026-06-10T06:24:21+00:00

I have this problem in some place in my code, when i try to

  • 0

I have this problem in some place in my code, when i try to put a fraction, the code simply ignores that part and act like it doesn’t exist. I’ll put some examples of my code here.

For example in my vtkBMPReader:

  vtkBMPReader *bmp= vtkBMPReader::New();
    bmp->SetDataByteOrderToLittleEndian();
    bmp->SetFilePrefix ("/home/matt/Desktop/ouBMP/exemplo");
    bmp->SetFilePattern("%s%d.bmp");
    bmp->SetFileNameSliceSpacing(1);
    bmp->SetNumberOfScalarComponents(3);
    bmp->SetDataOrigin(0,0,0);
    bmp->SetDataSpacing(0.011741683,0.005865103,0.047244094);//here it should be (6/511,6/1023,6/127)
    bmp->SetDataExtent(0,511,0,1023,1,128);
    bmp->Update();

and here:

// Function to transform the slider scale from pixel to mm
void planevolume::mm()
{
    // Set the sliders ranges and connections
    // X Slider
      double xvalue=ui->lcdNumber->value();
      ui->Slider->setValue(xvalue/(256/3));//here it does not work
      ui->Slider->setRange(xmin, xmax/(512/6), 1.0/(512/6));
      ui->Slider->setScale(xmin, (xmax+1)/(256/3), ((xmax+1)/16)/(256/3));//the last member does not work
      connect(ui->Slider, SIGNAL(valueChanged(double)), ui->lcdNumber, SLOT(display(double)));

    // Y Slider
      double yvalue=ui->lcdNumber_2->value();
      ui->Slider_2->setValue(yvalue/(512));//as here
      ui->Slider_2->setRange(ymin, ymax/(1023/2), 1.0/(1023/2));
      ui->Slider_2->setScale(ymin, (ymax+1)/512, (((ymax+1)/16)/512));//as here
      connect(ui->Slider_2, SIGNAL(valueChanged(double)), ui->lcdNumber_2, SLOT(display(double)));

    // Z Slider
      double zvalue=ui->lcdNumber_3->value();
      ui->Slider_3->setValue(zvalue/(64/3));//as here
      ui->Slider_3->setRange(zmin, zmax/(127/6), 1.0/(127/6));
      ui->Slider_3->setScale(zmin, (zmax+1)/(64/3),(((zmax+1)/16)/(64/3)));//as here
      connect(ui->Slider_3, SIGNAL(valueChanged(double)), ui->lcdNumber_3, SLOT(display(double)));
}

but in this one similar, it does work!

// Function to transform the slider scale from mm to pixel
void planevolume::pixel()
{
// Set the sliders ranges and connections
// X Slider
  double xvalue=ui->lcdNumber->value();
  ui->Slider->setValue(xvalue*(256/3));//here it works!!
  ui->Slider->setRange(xmin, xmax, 1.0);
  ui->Slider->setScale(xmin, xmax+1, (xmax+1)/16);
  connect(ui->Slider, SIGNAL(valueChanged(double)), ui->lcdNumber, SLOT(display(double)));

// Y Slider
  double yvalue=ui->lcdNumber_2->value();
  ui->Slider_2->setValue(yvalue*512);//here it works!!
  ui->Slider_2->setRange(ymin, ymax, 1.0);
  ui->Slider_2->setScale(ymin, ymax+1, (ymax+1)/16);
  connect(ui->Slider_2, SIGNAL(valueChanged(double)), ui->lcdNumber_2, SLOT(display(double)));

// Z Slider
  double zvalue=ui->lcdNumber_3->value();
  ui->Slider_3->setValue(zvalue*(64/3));//here it works!!
  ui->Slider_3->setRange(zmin, zmax, 1.0);
  ui->Slider_3->setScale(zmin, zmax+1, (zmax+1)/16);
  connect(ui->Slider_3, SIGNAL(valueChanged(double)), ui->lcdNumber_3, SLOT(display(double)));

}

if someone knows anything i can do please help me in this.

  • 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-10T06:24:23+00:00Added an answer on June 10, 2026 at 6:24 am

    I got it right by just adding a .0 to all the numbers.

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

Sidebar

Related Questions

I have this problem containing some inequations and requirement to minimize a value. After
I have this problem in my ASP.NET application where I'm seeing some of my
I have been tackling this problem for some time. I get the image from
I have some problem with this mongoid. It's my first time to use mongoDB,
Although I have found some solutions to this problem, none of them refer to
I'm getting crazy with this problem: I have got some Oracle SQL-Reports to redesign
I'm hoping people have some ideas to help solve this problem. I am developing
I have a work around for this problem, but I've been noticing some peculiar
I need some help in solving this problem. We have a large amount of
I hope some of you guys can help me with this problem.... I have

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.