Example #1
0
void    plDynamicTextMap::DrawImage( uint16_t x, uint16_t y, plMipmap *image, DrawMethods method )
{
    if( !IIsValid() )
        return;

    plMipmap::CompositeOptions  opts;
    if( method == kImgNoAlpha )
    {
        if( fHasAlpha )
            opts.fFlags = plMipmap::kForceOpaque;
        else
            opts.fFlags = plMipmap::kCopySrcAlpha; // Don't care, this is fastest
    }
    else if( method == kImgBlend )
        opts.fFlags = 0;        // Default opts
    else if( method == kImgSprite )
        opts.fFlags = plMipmap::kCopySrcAlpha;

    Composite( image, x, y, &opts );

    /// HACK for now, since the alpha in the mipmap gets copied straight into the
    /// 32-bit color buffer, but our separate hacked alpha buffer hasn't been updated
/*  if( fHasAlpha && !respectAlpha )
    {
        HBRUSH brush = ::CreateSolidBrush( RGB( 255, 255, 255 ) );
        RECT rc;
        ::SetRect( &rc, x, y, x + image->GetWidth(), y + image->GetHeight() );
        ::FillRect( fWinAlphaDC, &rc, brush );
        ::DeleteObject( brush );
    }
*/
}
Image::Pointer
VolumeVisualizationImagePreprocessor::Process(
  Image::Pointer m_originalCT, Image::Pointer m_originalLiverMask)
{
  VVP_INFO << "Processing...";

  // converting mitk image -> itk image
  CTImage::Pointer CTImageWork = CTImage::New();
  CastToItkImage( m_originalCT, CTImageWork );

  // converting mitk image -> itk image
  BinImage::Pointer BinImageMask = BinImage::New();
  CastToItkImage( m_originalLiverMask, BinImageMask );
  
  DetermineBoundingBox( BinImageMask );
  
  if( m_MaxX < m_MinX
   || m_MaxY < m_MinY
   || m_MaxZ < m_MinZ )
    return 0;
  
  CTImageWork = Gaussian(Crop( CTImageWork ));
  BinImageMask = Crop( BinImageMask );

  CTImage::Pointer itkResult =Composite(CTImageWork,BinImageMask,Dilate(BinImageMask),Erode(BinImageMask));

  mitk::Image::Pointer mitkResult= mitk::Image::New();
               mitk::CastToMitkImage( itkResult, mitkResult ); //TODO here we can perhaps save memory

  VVP_INFO << "Finished...";

  return mitkResult;
}
Example #3
0
TypeRef Program::define_struct(::std::string name, ::std::vector<Composite::item_t> items)
{
    if(name == "")
    {
        ::std::auto_ptr<Composite>  str(new Composite(Composite::TagStruct(), items));

        TypeRef ret(*str);

        m_anon_structs.emplace_back( str );

        return ret;
    }
    else
    {
        auto rv = m_named_structs.insert( ::std::make_pair(name, Composite(Composite::TagStruct(), items)) );
        if( rv.second == false )
        {
            throw ParseError::Todo("redefinition");
        }
        return TypeRef(rv.first->second);
    }
}