コード例 #1
0
ファイル: item.cpp プロジェクト: richardbeare/mrtrix3
        ROI_Item::ROI_Item (MR::Header&& src) :
            Volume (std::move (src)),
            saved (true),
            current_undo (-1)
        {
          type = gl::UNSIGNED_BYTE;
          format = gl::RED;
          internal_format = gl::R8;
          set_allowed_features (false, true, false);
          set_interpolate (false);
          set_use_transparency (true);
          value_min = 0.0f; value_max = 1.0f;
          set_windowing (0.0f, 1.0f);
          min_max_set();
          alpha = 1.0f;
          colour = preset_colours[current_preset_colour++];
          if (current_preset_colour >= 6)
            current_preset_colour = 0;
          transparent_intensity = 0.4f;
          opaque_intensity = 0.6f;
          colourmap = ColourMap::index ("Colour");
          float spacing = std::min ( { header().spacing(0), header().spacing(1), header().spacing(2) } );
          brush_size = min_brush_size = spacing;
          max_brush_size = 100.0f*min_brush_size;

          std::stringstream name;
          name << "ROI" << std::setfill('0') << std::setw(5) << new_roi_counter++ << ".mif";
          filename = name.str();

          MRView::GrabContext context;
          ASSERT_GL_MRVIEW_CONTEXT_IS_CURRENT;
          bind();
          allocate();
          ASSERT_GL_MRVIEW_CONTEXT_IS_CURRENT;
        }
コード例 #2
0
ファイル: item.cpp プロジェクト: JohnWangDataAnalyst/mrtrix3
        ROI_Item::ROI_Item (const MR::Image::Info& src) :
            Volume (src),
            saved (true),
            current_undo (-1)
        {
          type = gl::UNSIGNED_BYTE;
          format = gl::RED;
          internal_format = gl::R8;
          set_allowed_features (false, true, false);
          set_interpolate (false);
          set_use_transparency (true);
          set_min_max (0.0, 1.0);
          set_windowing (-1.0f, 0.0f);
          alpha = 1.0f;
          colour = preset_colours[current_preset_colour++];
          if (current_preset_colour >= 6)
            current_preset_colour = 0;
          transparent_intensity = 0.4f;
          opaque_intensity = 0.6f;
          colourmap = ColourMap::index ("Colour");
          float voxsize = std::min (src.vox(0), std::min (src.vox(1), src.vox(2)));
          brush_size = min_brush_size = voxsize;
          max_brush_size = 100.0f*min_brush_size;

          std::stringstream name;
          name << "ROI" << std::setfill('0') << std::setw(5) << new_roi_counter++ << ".mif";
          filename = name.str();

          Window::GrabContext context;
          bind();
          allocate();
        }