Options

[SOLVED] How to insert image to a report

CharlieFirpoCharlieFirpo Member Posts: 48 Contributor II
edited November 2018 in Help
Dear All!

Is it possible to insert an image into a RapidMiner report? There is no an operator as "Add Image" like "Add Text" or "Add Section".
But when generating a report with "Report" operator (Data Table, Plot View), then the report will contain an image, so someway it is possible to insert images into reports. Can anybody tell how?

Thank you!

Answers

  • Options
    CharlieFirpoCharlieFirpo Member Posts: 48 Contributor II
    I installed the "Image Processing" extension, so now I can open an image with "Open color Image" operator. The output of this operator can be the inupt of the "Generate Report" and "Report" operators. In "Report" operator, I can select the "ColorImagePlus" reportable type, and the "ImagePlus" reportable view. But my report output does not show/contain the image. But the RapidMiner Results perspective shows the image correctly (ImagePlusClrIOObject (Open Color Image) / ImagePlus).

    Has anyone any idea why the reporting result does not contain the image? If I select the "Info" reportable view, then my report contains the image infos correctly.
  • Options
    CharlieFirpoCharlieFirpo Member Posts: 48 Contributor II
    Hi!

    Nobody knows about this bug or behavior? Nobody can help me? What should I do?
  • Options
    radoneradone RapidMiner Certified Expert, Member Posts: 74 Guru
    Hello CharlieFirpo,
    would it be possible to share the process with us? We will check the problem soon (we are currently to RCOMM conference so sorry for slight delay). There is currently no such an operator but thank you for the tip. We will try to implement the operator soon.



  • Options
    CharlieFirpoCharlieFirpo Member Posts: 48 Contributor II
    Hello radone!

    Thank you for helping me!
    I created a simple process with these operators: 'Open Color Image' + 'Generate Report' + 'Report'
    At 'Report' I selected ColorImagePlus reportable type and ImagePlus reportable view. The created report does not contain the image. If I select the Info reportable view then the report contains the informations of the image.

    Here is the process (I used the built-in RM logo.png as the image to open):
    <?xml version="1.0" encoding="UTF-8" standalone="no"?>
    <process version="5.3.013">
     <context>
       <input/>
       <output/>
       <macros/>
     </context>
     <operator activated="true" class="process" compatibility="5.3.013" expanded="true" name="Process">
       <parameter key="logverbosity" value="init"/>
       <parameter key="random_seed" value="2001"/>
       <parameter key="send_mail" value="never"/>
       <parameter key="notification_email" value=""/>
       <parameter key="process_duration_for_mail" value="30"/>
       <parameter key="encoding" value="SYSTEM"/>
       <parameter key="parallelize_main_process" value="false"/>
       <process expanded="true">
         <operator activated="true" class="imageprocessing:open_color_image" compatibility="1.4.001" expanded="true" height="60" name="Open Color Image" width="90" x="45" y="75">
           <parameter key="filename" value="C:\temp\logo.png"/>
           <parameter key="set_mask" value="false"/>
           <parameter key="force_conversion" value="true"/>
         </operator>
         <operator activated="true" class="reporting:generate_report" compatibility="5.3.000" expanded="true" height="76" name="Generate Report" width="90" x="179" y="75">
           <parameter key="report_name" value="report"/>
           <parameter key="format" value="HTML"/>
           <parameter key="report_to_repository" value="false"/>
           <parameter key="html_output_directory" value="C:\temp"/>
           <parameter key="html_image_format" value="png"/>
           <parameter key="image_col_span" value="8"/>
           <parameter key="image_row_span" value="17"/>
           <parameter key="page_size" value="A4"/>
           <parameter key="page_format" value="portrait"/>
           <parameter key="template_type" value="none"/>
           <parameter key="image_alignment" value="aspect_ratio"/>
           <parameter key="set_background_color" value="false"/>
           <parameter key="background_color" value="255,255,255"/>
           <parameter key="page_width" value="595"/>
           <parameter key="page_height" value="842"/>
           <parameter key="top_page_margin" value="36"/>
           <parameter key="bottom_page_margin" value="36"/>
           <parameter key="left_page_margin" value="36"/>
           <parameter key="right_page_margin" value="36"/>
           <parameter key="section_one_font_size" value="12.0"/>
           <parameter key="section_one_font_style_bold" value="false"/>
           <parameter key="section_one_font_style_italic" value="false"/>
           <parameter key="section_one_font_style_underline" value="false"/>
           <parameter key="section_one_font_style_strikethrough" value="false"/>
           <parameter key="section_one_font_color" value="0,0,0"/>
           <parameter key="section_two_font_size" value="12.0"/>
           <parameter key="section_two_font_style_bold" value="false"/>
           <parameter key="section_two_font_style_italic" value="false"/>
           <parameter key="section_two_font_style_underline" value="false"/>
           <parameter key="section_two_font_style_strikethrough" value="false"/>
           <parameter key="section_two_font_color" value="0,0,0"/>
           <parameter key="section_three_font_size" value="12.0"/>
           <parameter key="section_three_font_style_bold" value="false"/>
           <parameter key="section_three_font_style_italic" value="false"/>
           <parameter key="section_three_font_style_underline" value="false"/>
           <parameter key="section_three_font_style_strikethrough" value="false"/>
           <parameter key="section_three_font_color" value="0,0,0"/>
           <parameter key="section_four_font_size" value="12.0"/>
           <parameter key="section_four_font_style_bold" value="false"/>
           <parameter key="section_four_font_style_italic" value="false"/>
           <parameter key="section_four_font_style_underline" value="false"/>
           <parameter key="section_four_font_style_strikethrough" value="false"/>
           <parameter key="section_four_font_color" value="0,0,0"/>
           <parameter key="section_five_font_size" value="12.0"/>
           <parameter key="section_five_font_style_bold" value="false"/>
           <parameter key="section_five_font_style_italic" value="false"/>
           <parameter key="section_five_font_style_underline" value="false"/>
           <parameter key="section_five_font_style_strikethrough" value="false"/>
           <parameter key="section_five_font_color" value="0,0,0"/>
           <parameter key="text_content_font_size" value="12.0"/>
           <parameter key="text_content_font_style_bold" value="false"/>
           <parameter key="text_content_font_style_italic" value="false"/>
           <parameter key="text_content_font_style_underline" value="false"/>
           <parameter key="text_content_font_style_strikethrough" value="false"/>
           <parameter key="text_content_font_color" value="0,0,0"/>
           <parameter key="system_fonts" value="false"/>
           <parameter key="directory_fonts" value="false"/>
           <parameter key="table_column_number" value="8"/>
           <parameter key="table_header_color" value="128,128,128"/>
           <parameter key="table_row_color_one" value="255,255,255"/>
           <parameter key="table_row_color_two" value="192,192,192"/>
         </operator>
         <operator activated="true" class="reporting:report" compatibility="5.3.000" expanded="true" height="60" name="Report" width="90" x="313" y="75">
           <parameter key="report_name" value="report"/>
           <parameter key="report_item_header" value="Here is an image:"/>
           <parameter key="specified" value="true"/>
           <parameter key="reportable_type" value="ColorImagePlus"/>
           <parameter key="renderer_name" value="ImagePlus"/>
           <list key="parameters"/>
           <parameter key="image_width" value="800"/>
           <parameter key="image_height" value="600"/>
         </operator>
         <connect from_op="Open Color Image" from_port="color image plus" to_op="Generate Report" to_port="through 1"/>
         <connect from_op="Generate Report" from_port="through 1" to_op="Report" to_port="reportable in"/>
         <connect from_op="Report" from_port="reportable out" to_port="result 1"/>
         <portSpacing port="source_input 1" spacing="0"/>
         <portSpacing port="sink_result 1" spacing="0"/>
         <portSpacing port="sink_result 2" spacing="0"/>
       </process>
     </operator>
    </process>
  • Options
    StaryVenaStaryVena Member Posts: 126 Contributor II
    Hello Charlie,
    this issue was fixed in a new version of the image mining extension.

    The new version is not yet available on the Market place, but you can request it by filling this formular: http://www.burgsys.com/contact.php.

    Best,
    Vaclav
  • Options
    CharlieFirpoCharlieFirpo Member Posts: 48 Contributor II
    Thank you Vaclav!

    I will try it!
  • Options
    CharlieFirpoCharlieFirpo Member Posts: 48 Contributor II
    Thank you again Vaclav!
    It works perfectly!

    'Read Image' + 'Generate Report' + 'Report' operators, at 'Report' choose the Image reportable type and Image reportable view, and the generated report contains the image!
Sign In or Register to comment.