How to create a 16-bit grayscale image from matrix of values

Hello all,
I'm having a problem converting a series of measurements into a specific image. I have a matrix of nxm dimensions (n and m variable), which contains measurement data. My intention is to transform this matrix into an image to be analyzed later on by an external software. The trick, however, is that the image has to be in 16-bit grayscale format: in grayscale for doing the image processing, and 16 bits to make sure that resolution is not hindered.
I've been looking around the web and still haven't found a way of somehow mapping the measurement values I have in that matrix into pixels (16-bit grayscale ones, that is). I have access to the Full Development System version of LabView, but not other toolboxes.
Does anyone have any suggestions?
Solved!
Go to Solution.

Hi everyone,
I've managed to get it to work thanks to some help from people on other forums. The key is to use the IMAQ driver, which gives the VIs necessary to create images on 16-bit grayscale (only supported nicely by PNG format apparently).
The discussion on the other forum can be found here: http://stackoverflow.com/questions/11101420/structure-of-16-bit-grayscale-image-to-be-generated-in-c...
The IMAQ driver can be found here: http://search.ni.com/nisearch/app/main/p/bot/no/ap/tech/lang/en/pg/1/sn/catnav%3adu,n13%3ahardwareDr...

Similar Messages

  • How to create an gray scale png image from intensitie​s values

    Hi,
      I would like create a gray scale png image from set of intensities values which is saved in excel sheet . Is IMAQ tool necessary for this vi?
    thanks & regards
    Manoj

    You posted in the feedback forum, which is not correct for your question. I am guessing you are talking about LabVIEW since you mention "vi".
    manojkp89 wrote:
    Is IMAQ tool necessary for this vi?
    The answer is NO. Plain LabVIEW is sufficient.
    LabVIEW Champion . Do more with less code and in less time .

  • Display/save 8 bit grayscale image

    I have a VI that is capturing an 8 bit grayscale image (1D array of 1500 pixels). It has a 10 byte header that I strip off and try to display it.  The problem is that the displayed picture is interpeted as an RGB.  Also, the saved image can be opened using a picture viewer but is not correct.  It is missing the pixel data. How do I get this to display as an 8 bit grayscale image.  I would also like to duplicate the 1 row of image data to about 50 rows so that it is easier to view.  using a for loop and indexing the row only leaves the pxmao empty.
    Solved!
    Go to Solution.

    Bjoles,
    You are missing a colour table input to your flatten pixmap block. See the vi snippet I have attached. Also, I have found that building arrays from a for loop is a quick way of doing it, Labview seems to preallocate the memory correctly.
    Luke_A_P
    Attachments:
    build stripe.png ‏24 KB

  • Creating a 16-bit grayscale JPEG?

    I am trying to creat a 16-bit grayscale JPEG in Java. The code below will work for TIFF and it will also work for 8-bit grayscale JPEGs but not 16. When I do this it throws a run time exception saying I can only creat 1 or 3 banded images.
    What is my problem?
                int [] bits = {16};
                ColorModel colorModel = new ComponentColorModel(ColorSpace.getInstance(ColorSpace.CS_GRAY),bits,false,false, Transparency.OPAQUE,DataBuffer.TYPE_USHORT);
                SampleModel samp = new BandedSampleModel(DataBuffer.TYPE_USHORT,width,height,1);
                Raster ras = null;
                Point p = new Point();
                WritableRaster WR = ras.createWritableRaster(samp,p);
                for(int x=0; x<width; x ++)
                    double intensity = (double)x * 65000 / (double)width;
                   // intensity -= 32500;
                    for(int y=0; y<height; y++)
                        WR.setSample(x, y, 0, intensity);
                BufferedImage test = new BufferedImage(colorModel,WR,false,null);
                RenderedImage ri = test;
                String filename = new String("JPEG/16Bitgray.jpeg");
                OutputStream out = new FileOutputStream(filename);
                JPEGEncodeParam param = new JPEGEncodeParam();
                float q = (float)1.0;
                param.setQuality(q);
                ImageEncoder encoder = ImageCodec.createImageEncoder("JPEG", out, param);
                encoder.encode(ri); 

    As far as I know notion of 16 bit greyscale images is not present in JPEG specification but its available in JPEG2000. At the moment JDK supports JPEG but not JPEG2000 (both ImageIO and Toolkit) and it does not try to convert images automatically.
    One possibility is to try JAI JPEG2000 ImageIO plugin (https://jai-imageio-core.dev.java.net/).
    Another option is to convert image to something that is supported by JDK (you can test it using ImageWriterSpi.canEncode()) and then save it.
    For instance:
       BufferedImage gray16;
       BufferedImage bi = new BufferedImage(w, h, TYPE_INT_RGB);
       Graphics g = bi.createGraphics();
       g.drawImage(gray16, 0, 0, null);
       ImageIO.write(bi, "jpeg", out_file);

  • Using conversion to array to add 16 bit grayscale images

    Dear all,
    Usual disclaimers, first post, tried to search using a variety of terms, no luck, so posting a new question!
    I am trying to perform a running a verage of a 16 bit grayscale image. I do not have access to the Vision development module.  My 'workaround' is to grab the image, convert to array and then, using a shift register, to add this array to that acquired at the previous loop iteration. The problem I am having is that the shift register, despite being fed data in a 16 bit unsigned word formatt, returns 8 bit data. The add function is then trying to add 16 bit to 8 bit data and returns an empty array.
    Can anyone help? Surely it must be possible to use shift registers with arrays of 16 bit data?
    Any help appreciated!

    Shift registers work with all datatypes. Can you show us your code?
    LabVIEW Champion . Do more with less code and in less time .

  • How to create a contact sheet of images in CS5

    How to create a contact sheet of images in CS5.  Different set up than older version I worked on before.

    Have I missed something that the Adobe Bridge Output Module didn’t seem to offer a printing option?  Tried the older plug-in which is what I was familiar with, but that seems to download all the plug ins, not just contact sheets. Do I have to download the whole shebang?

  • How can I download automatically only new images from my camera?

    Hello,
    I can not download only new images from my EOS 450D-camera with Elements 10-Photodownloafer (Mac os).
    Each time I use Photodownloader it downloads all images , also those that were downloaded preveously
    How can I set photodownloader?
    Thanks for your advices

    I share my card with my wife and she likes to download our images also on her PC, so erasing all images is not an option.
    It seems that earlier version of adobe photo downloader has the feature "copy only new files" , but V10 does not.
    Thanks for your answer
    Mikele
    Op 10-jun.-2012, om 15:33 heeft 99jon het volgende geschreven:
    Re: How can I download automatically only new images from my camera?
    created by 99jon in Photoshop Elements - View the full discussion
    Don’t you format the card in the camera after each download? That will wipe all images and prepare the card for a fresh shoot.
    Replies to this message go to everyone subscribed to this thread, not directly to the person who posted the message. To post a reply, either reply to this email or visit the message page: http://forums.adobe.com/message/4480409#4480409
    To unsubscribe from this thread, please visit the message page at http://forums.adobe.com/message/4480409#4480409. In the Actions box on the right, click the Stop Email Notifications link.
    Start a new discussion in Photoshop Elements by email or at Adobe Forums
    For more information about maintaining your forum email notifications please go to http://forums.adobe.com/message/2936746#2936746.

  • How to create a Blanket Release in iProc from a approved requistion

    Hi Gurus,
    How to create a blanket Release in iProcurement from a approved requisition. I have followed the below steps.
    1. Created a BPA from Front end.
    2. Run Loader Data program.
    3. Above program reflected the BPA in iProc.
    4. Created requisition from BPA.
    5. Requisition has been approved.
    After this i am stuck. How to proceed ahead. I want to create a Blanket Release from approved PR and then receive in iProcurement.
    please help me on this. We are using 11.5.10.2
    Regards,
    john

    911765 wrote:
    Hi Mahendra,
    Thank you so much for your reply.
    So you mean to say that it all depends upon the Sourcing Rule and ASL based upon that system would automatically create a Blanket Release or If its Automatic Release/Review then we have to manually create release through autocreate.
    The reason why i am asking this query is now when i tested it, system is automatically creating release and starngely there is no Sourcing Rule and ASL has been defined.
    But we are looking for a Manual Release through autocreate window.
    It would be great if you could please suggest.
    Regards,
    JohnJohn,
    When you say system is automatically creating release..as far as i know...it should be referencing a PO..correct...in the releases window..
    can you pull that up..and see if you can get any clue..bcz that PO would BPA...
    Also I am not that much into Iproc...I don't know...whether Iproc has some other setups
    HTH
    Mahendra

  • How to create pdf files in UNIX directory from oracle reports

    I would like to know how to create pdf files in UNIX directory from oracle reports.
    Thanks,

    Please make your question more clear . Also mention the reports version.
    1) If you are runnning reports in Unix, you can give
    .... destype=file desformat=pdf desname=<filename>
    in command line
    Please refer docs below.
    2) If by your question you mean
    "My reports server is running in Windows but I want to ftp my files to Unix after creating it"
    then the answer is that you can use pluggable destination "ftp"
    .... destype=ftp desformat=pdf desname=<ftp url>
    Pluggable destinations download
    http://otn.oracle.com/products/reports/pluginxchange/index.html
    Thanks
    Ratheesh
    [    All Docs     ]
    http://otn.oracle.com/documentation/reports.html
    [     Publishing reports to web  - 10G  ]
    http://download.oracle.com/docs/html/B10314_01/toc.htm (html)
    http://download.oracle.com/docs/pdf/B10314_01.pdf (pdf)
    [   Building reports  - 10G ]
    http://download.oracle.com/docs/pdf/B10602_01.pdf (pdf)
    http://download.oracle.com/docs/html/B10602_01/toc.htm (html)
    [   Forms Reports Integration whitepaper  9i ]
    http://otn.oracle.com/products/forms/pdf/frm9isrw9i.pdf

  • HT5517 How can have full picture using mirrored image from iPad

    How can have full picture using mirrored image from iPad on my Apple TV airplay

    Welcome to the Apple Community.
    Mirroring won't fill the TV screen. The iPad has an aspect ratio of 4:3 and the iPhone 4S or prior an aspect ratio of 3:2, neither of these will fit exactly into a TV screen which as an aspect ratio of 16:9. The Apple TV will not zoom the mirrored image, because it may well cut off information which is situated at the top or bottom of the screen.
    You may wish to try each of the settings in ‘Settings > Audio & Video > Adjust for AirPlay overscan’ for the best setting that suits you.

  • How to create a service entry sheet based from the PO

    how to create a service entry sheet based from the PO
    Gurus,
    I am creating a service entry sheet from the PO but I am getting an error of u201CPlease maintain services or limits Message no. SE029- Diagnosis(You cannot enter data until the PO item has been maintained correctly) u201C
    The document type of the PO is standard NB, account assignment category is Q- (Proj make to order) and the item category is D(service). Then I am trying also create a PR using account assignment category is Q- (Proj make to order) and the item category is D(service) but still cannot proceed, a message asking me to enter a service entry number. What I know the process is create a PO(maybe based from PR) then post the GR then create a service entry sheet in ML81N but I cannot proceed. Just creating a PR or PO using those mentioned account assignment and item category and getting an error of need to enter a service entry sheet number.
    Please help.thanks!

    HI,
    Process for Creating Service Entry Sheet
    Transaction Code :    ML81N
    1)To open the respective Purchase Order, Click on the u2018Other Purchase Orderu2019, then enter the Purchase Order No.
    2)Click on the u2018Create Entry Sheetu2019 icon(3rd Icon on Top-Left)
    3)Give Short Text (e.g. R/A Bill No. 1) and top service entry sheet number also generated.
    4)Click u2018Service Selectionu2019 Icon on the Bottom of the Screen.
    5)For the 1st Time, when we are making Service Entry Sheet for a respective Purchase Order, we need to u201CAdopt Full Quantityu201D by clicking the Check box next to it, then Enter.  (*For the next time, no adoption is required, just continue)
    6)Select the respective Services by clicking on the Left Hand Side, then Click u2018Servicesu2019 (Adopt services) icon on the Top.
    7)Give the completed Quantity, then Click u2018Acceptu2019 icon(a green flag on the top)
    8)Save .
    9)Service Entry Sheet is SAVED and account posting made.
    Hope, it is useful for you,
    Regards,
    K.Rajendran

  • How come I can't export a image from lightroom 3 that is 600w x 610h?

    How come I can't export a image from lightroom 3 that is 600w x 610h?

    I think thats what I'm doing.  No luck though. Maybe its a bug?

  • How do I remove the target-like images from my pdf?

    How do I remove the target-like images from my pdf? There are four of them, one in the very top center, very bottom center, far left center, and far right center.

    Are you saying they haven't always been there? If they have been, they're likely registration marks.

  • Problem loading images from a return value of a function

    hello, I write because I uin problem in loading images from a return value of a function.
    I created a database with a field "image" of type string, where I put the physical address of the image. I have written like this: {__DIR__ }foto.jpg
    Place the code, so you understand better
    function imageViewImage(): javafx.scene.image.Image {
    connetti();
    lass.forName(driverName);
    con = DriverManager.getConnection(url,user,"");
    stmt = con.createStatement();
    var richiesta:String = "SELECT image from viaggio WHERE id_viaggio=7";
    rs1 = stmt.executeQuery(richiesta);
    var result :String;
    rs1.next();
    risultato = rs1.getString("image");
    JOptionPane.showMessageDialog(null, result);
    var imagez = Image{
    url:"{result}";
    return imagez;
    The image is in the source code package
    First I connect to the database, run the query and I take the contents of the image.
    Can anyone help me?
    Is right to put in the database {__DIR__} foto.jpg or do I put only foto.jpg?

    Hello unkus_nob,
    I would rather suggest you to save only filename of that image like "foto.jpg" in database. And just concat it with the String variable containing "{__DIR__}".
    Actually the javafx compiler converts the {__DIR__} to the existing class directory path something like : "jar:file:/..../".
    var currentDir ="{__DIR__}";
    risultato = "{currentDir}{rs1.getString("immagine"})"; 
    var image = Image{
        url:risultato
    return image;--NARAYAN G.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Encode and Decode 16 bit grayscale image to jpeg2000

    i am trying to convert 10 bit grayscale raw image to jpeg 2000 using J2KImageWriter and i want it to convert back to grayscale raw image but when i am converting it it gives NULL.
    Here is my code
    public class Main {
    public static void main(String[] args) {
    if(args.length!=4)
    System.out.println("\nEnter imagefile height width header\n");
    System.exit(0);
    String filename=args[0];
    int height=Integer.parseInt(args[1]);
    int width=Integer.parseInt(args[2]);
    int header=Integer.parseInt(args[3]);
    try
    //reading the image data
    FileInputStream imagefile=new FileInputStream(filename);
    System.out.println("\nSize of image file:"+imagefile.available());
    System.out.println("\nHeader:"+String.valueOf(header)+" bytes\n");
    imagefile.skip(header);
    short pixels[]=new short[height*width];
    int i,j,k;
    k=0;
    for(i=0;i<height;i++)
    for(j=0;j<width;j++)
    int lsb=imagefile.read();
    int msb=imagefile.read();
    pixels[k]=(short)(msb<<8 | lsb);
    k++;
    //System.out.println(String.valueOf(pixels[i][j]));
    imagefile.close();
    DataBuffer buffer=new DataBufferUShort(pixels,width*height);
    SampleModel sm=RasterFactory.createBandedSampleModel(DataBuffer.TYPE_USHORT,height,width,1);
    Raster raster=RasterFactory.createWritableRaster(sm, buffer,new Point(0,0));
    //imagedata reading complete
    //conversion to jpeg 2000
    String outfile=args[0].substring(0,args[0].lastIndexOf('.'))+".jp2";
    File outimage=new File(outfile);
    ImageOutputStream imout=ImageIO.createImageOutputStream(outimage);
    J2KImageWriteParam j2kparam=new J2KImageWriteParam();
    J2KImageWriterSpi spi=new J2KImageWriterSpi();
    J2KImageWriter j2kwriter=new J2KImageWriter(spi);
    j2kparam.setLossless(true);
    j2kparam.setComponentTransformation(false);
    j2kparam.setEncodingRate(0.5f);
    j2kparam.setFilter(J2KImageWriteParam.FILTER_53);
    j2kparam.setNumDecompositionLevels(3);
    j2kparam.setWriteCodeStreamOnly(true);
    j2kwriter.setOutput(imout);
    j2kwriter.write(null,new IIOImage(raster,null,null),j2kparam);
    imout.close();
    J2KImageReaderSpi j2kspi=new J2KImageReaderSpi();
    J2KImageReader j2kreader=new J2KImageReader(j2kspi);
    ImageInputStream imin=ImageIO.createImageInputStream(outfile);
    j2kreader.setInput(imin, true, false);
    Raster decomp_raster=j2kreader.readRaster(1, null);
    int outputdata[]=new int[width*height];
    decomp_raster.getPixels(0,0,width,height,outputdata);
    FileOutputStream fileout=new FileOutputStream("decomp");
    for(i=0;i<height*width;i++)
    short temp=(short)outputdata;
    fileout.write(Short.valueOf(temp).byteValue());
    Short a=new Short(Short.reverseBytes(temp));
    fileout.write(a.byteValue());
    fileout.close();
    catch(Exception e)
    System.out.println(e.getMessage());
    Can anybody help me with this. Actually i need to study the performance of jpeg2000 compression using different setting of parameters.
    Thanks in advance.......

    Hi,
    I am able to encode and decode the image using J2Kwriter and J2Kreader classes. But now some other issue has came up.
    When compressed losslessly, the new jpeg2000 filesize is 415245 bytes. (My original file is of size 2000000 bytes)
    But when i am doing lossy compression, it results in following file sizes.
    Below 0.5 (encoding rate) - 535 bytes.
    Greater than or equal to 0.5 - 541 bytes.
    I tried with the following values of encoding rate - 0.1, 0.3, 0.5, 0.8, 1, 1000, 100000000, 500000000.
    I m not able to understand why i am getting the same filesize even with different encoding rate.
    How should i set the encoding rate parameter to achieve my target compression ratio.
    Kindly guide me. I will be very thankful to you.
    Preeti

Maybe you are looking for

  • To change the Email retrieval logic for MSS in Portal

    Hi All, In standard MSS Business Package for employee selection Iview, under column email, manager get an option to send mail to employee by clicking on highlighted send option. At present the option "SEND" get highlighted if the email value is maint

  • Error code check

    select distinct LOANPAY.ID, sum(TotalPay) from (select LoanID, EffectiveDate, PrincipalPay+InterestPay+OtherPay as TotalPay from Loanpay inner join history on loanpay.id = history.id where EffectiveDate between '2014-01-01' AND '2014-01-31') group by

  • Loading Norton AntiVirus 10.0 in OS 10.4.2

    Tried loading my new anti-viurs product, Norton AntiVirus 10.0, and was given an alert on my iBook that I couldn't continue loading due to needing a BSD package in OS 10.4.2. What is that, and how do I make that happen in my computer? Thanks. elbowpi

  • Replacing 4G phone

    In the event that I have some catastrophic problem and Apple decides to swap phones, I'm assuming I'd have to pony up $100 to get an 8G phone since a 4G would most likely not be available. Does anyone know the official Apple policy? Would they be les

  • Retrive FMS server date to AS3

    hi, i m working on a customer support chat application. There is neccssary for me to get the FMS server time and date, bcoz depending on the server time and date the client instances recive different messages. i looked at date() function on FMS serve