Newbee help for dicom image window center/width manipultation

We have a flash based dicom viewer and i have the folowing code in action script which i want to replace with pixel bender code. is it possible ?
var img_bmp:BitmapData = new BitmapData(Cols, Rows,false,0);
for (var y:Number = 0; y <Rows; y++) {
for (var x:Number = 0; x <Cols; x++) {
gray =  byteArray.readUnsignedShort()*Slope + Intercept;
gray = 255 * gray/WindowWidth  -  Min * 255 / WindowWidth;
gray = uint(gray);
var r:int = gray;
var g:int = gray;
var blue:int = gray;
var c:uint = (r << 16) | (g << 8) | blue;
    img_bmp.setPixel(x, y, c);
Where byteArray is a unsignedshort  sequnce. Slope, intercept, WindowWidth and Min are constants.
From the little i understood of the kernel programming the expected input channel cannot be 2 channel or single channel input.
can any one suggest how i can proceed or give me pointers or for this kind of image manipulation pixel bender is not suitable.
Thanks in advance
Sastradhar

i wrote the below kernel code and compiled using pbutil and it did compile i am having trouble determining the shader width and height.  can some one help me out.
<languageVersion: 1.0;>
kernel pixel
<   namespace : "TMP";
     vendor : "TMP";
     version : 1;
>
         input image1 src;
         output pixel3 dst;
         parameter float Intercept;
         parameter float Slope;
         parameter float WindowWidth;
         parameter float Min;
          void
           evaluatePixel()
        float gray = sample(src, outCoord())*Slope + Intercept ;
              gray =  255.0 * gray/WindowWidth  -  Min * 255.0 / WindowWidth;
              dst = pixel3(gray,gray,gray);
can some one tell me how to get the shader width and height so so that pixel bender can only act on 16 bits or did i get the whole thing wrong.
shader.data.src.input = byteArray;
  shader.data.Slope = Slope;
  shader.data.Intercept = Intercept;
  shader.data.Min = Min;
  shader.data.WindowWidth = WindowWidth;
  shader.data.src.width = Cols >> 1;
  shader.data.src.height = Rows ;
  var myJob:ShaderJob = new ShaderJob(shader, img_bmp,Cols, Rows);
  myJob.addEventListener(ShaderEvent.COMPLETE, pixelComplete);
  myJob.start();
Thanks in advance

Similar Messages

  • F4 help for pop up window

    Hi guys,
                 for pop up window i need f4 help..... actually wt the task is if i  give the program name, that program contents have to save in a text file... for that i need to specify the path ie., where i have to save the text file...
                i have done some coding on it i dont weather the function module i used is correct? and for that i need f4 help....
             so plx tell me how to use f4 help for the function module and also wt is the exact function module for pop up window....
    here is the code.............
    REPORT  ZTEST_DOWNLOAD.
    PARAMETERS :  P_PROG(30) TYPE c.
    DATA: ITAB TYPE TABLE OF STRING.
    READ REPORT P_PROG INTO ITAB.
    CALL FUNCTION 'RSO_DIRECTORY_POP_UP'
    IMPORTING
      E_DIRECTORY       =
    EXCEPTIONS
       FAILED            = 1
       CANCELLED         = 2
       OTHERS            = 3
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    START-OF-SELECTION.
    data: progname type string.
    progname = P_PROG.
    CALL FUNCTION 'GUI_DOWNLOAD'
      EXPORTING
      BIN_FILESIZE                    =
        FILENAME                        =   PROGNAME
        FILETYPE                        = 'ASC'
      TABLES
        DATA_TAB                        = ITAB
      FIELDNAMES                      =
    EXCEPTIONS
       FILE_WRITE_ERROR                = 1
       NO_BATCH                        = 2
       GUI_REFUSE_FILETRANSFER         = 3
       INVALID_TYPE                    = 4
       NO_AUTHORITY                    = 5
       UNKNOWN_ERROR                   = 6
       HEADER_NOT_ALLOWED              = 7
       SEPARATOR_NOT_ALLOWED           = 8
       FILESIZE_NOT_ALLOWED            = 9
       HEADER_TOO_LONG                 = 10
       DP_ERROR_CREATE                 = 11
       DP_ERROR_SEND                   = 12
       DP_ERROR_WRITE                  = 13
       UNKNOWN_DP_ERROR                = 14
       ACCESS_DENIED                   = 15
       DP_OUT_OF_MEMORY                = 16
       DISK_FULL                       = 17
       DP_TIMEOUT                      = 18
       FILE_NOT_FOUND                  = 19
       DATAPROVIDER_EXCEPTION          = 20
       CONTROL_FLUSH_ERROR             = 21
       OTHERS                          = 22
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    Thanks in advance..............

    Use this code.. F4 help for both Application as well as Presentation Server..
    *                      Form  FILE_F4_APP
    *      Help on Selection-screen for file on Application Server
    form file_f4_app .
      call function '/SAPDMC/LSM_F4_SERVER_FILE'
        exporting
          filemask         = space
        importing
          serverfile       = p_name
        exceptions
          canceled_by_user = 1
          others           = 2.
      if sy-subrc is not initial.
        p_name = space.
      endif.
    endform.                    " FILE_F4_APP
    *                      Form  FILE_F4_PRE
    *           Filename F4 help for Presentation Server
    form file_f4_pre .
    * Local Constant
      constants: l_c_p type c length 1 value 'P'.
    * Local Data
      data: l_path type c length 255.
      call function 'F4_DXFILENAME_TOPRECURSION'
        exporting
          i_location_flag = l_c_p
          i_path          = l_path
        importing
          o_path          = l_path
        exceptions
          rfc_error       = 1
          error_with_gui  = 2
          others          = 3.
      if sy-subrc eq 0.
        p_name = l_path.
      endif.
    endform.                    " FILE_F4_PRE
    Please award points..
    Thanks,
    Rahul

  • How do I change Transfer Syntax for DICOM images using sample Java sources?

    Hi,
    I tested using Note:876534.1 Java API samples. It works fine when I put the "Implicit VR Little Endian" DICOM file.
    I could insert the DICOM file, also I could get the all DICOM tags correctly by SQL.
    But I could not get all DICOM tags when inserted "Explicit VR Little Endian" and "JPEG Lossy" DICOM file.
    Also I could not find how to change the Transfer Syntax to orddicom Java API.
    How do I change following simple java source for inserting different Transfer Syntax DICOM file?
    Connection conn = DriverManager.getConnection(args[0], args[1], args[2]);
    System.out.println("Got database connection");
    conn.setAutoCommit(false);
    Statement stmt = conn.createStatement();
    CallableStatement cs = null;
    cs = conn.prepareCall("begin ord_dicom.setDataModel(); end; ");
    cs.execute();
    cs.close();
    String rowInsertSQL = "insert into dicom_test (id, dcmobj) values (" + args[3] + ",ordsys.orddicom())";
    stmt.execute(rowInsertSQL);
    System.out.println("Inserted empty dicom object ...");
    String rowSelectSQL = "select dcmobj from dicom_test where id = " + args[3] + " for update";
    OracleResultSet rset = (OracleResultSet)stmt.executeQuery(rowSelectSQL);
    rset.next();
    OrdDicom dcmProxy = (OrdDicom)rset.getORAData("dcmobj", OrdDicom.getORADataFactory());
    rset.close();
    System.out.println("selected row for update...");
    File testFile = new File(args[4]);
    boolean success = dcmProxy.loadContent(testFile, true);
    dcmProxy.setProperties();
    if (success) {            
    String updateSQL = "update dicom_test set dcmobj=? where id=" + args[3];
    OraclePreparedStatement opstmt =
    (OraclePreparedStatement)conn.prepareStatement(updateSQL);
    opstmt.setORAData(1, dcmProxy);
    opstmt.execute();
    int contentLength = dcmProxy.getContentLength();
    String SOPInstanceUID = dcmProxy.getSOPInstanceUid();
    System.out.println("contentLength: " + contentLength);
    System.out.println("SOPInstanceUID: " + SOPInstanceUID);
    opstmt.close();
    Thanks,
    Tatsuya
    Edited by: user13490925 on 2011/01/31 1:48

    It would go like this
    1. TIFF + XML metadata => DICOM image file
    you can use the method ord_dicom.createDicomImage(src blob, metadata xmltype, dest blob) to create the DICOM image in a blob.
    2, then use the ORDDicom constructor ORDDIcom(data blob) to create an ORDDicom object
    3. then use the ORDDicom processCopy method to change the image properties.
    Alternatively you can change image properties on the input TIFF image (using ORDImage methods) then create the DICOM image. If you are happy with the image properties then you can skip step 3.
    Edited by: rabbott on Jun 22, 2009 12:41 PM

  • Skillbuilders Modal Page Plugin - Help in setting Modal window height/width

    Hello Apex Experts,
    I have downloaded the Skillbuilders Modal Page Plugin. I have tried to implement the same but my modal window is not showing correctly. I can see all the fields and scroll bar. I also tried to set the initial height/width settings but no luck.
    Can anyone help me?
    Your help would be appreciated.
    FYI: I'm using Apex v4.2 on Google Chrome.
    Many Thanks,
    Bhavin

    Bhavin,
    Go into the setting in the Shared Components for the plug-in and change the theme from custom to a number (1-5). Also, make sure to read this:
    http://www.danielmcghan.us/2011/08/new-browser-security-attributes-in-apex.html
    Regards,
    Dan
    blog: http://DanielMcghan.us/
    work: http://SkillBuilders.com/APEX/

  • Help for all frustrated windows itune 5 downloaders

    I recently downloaded itunes 5 and couldn't open it even though the download was successful. I messed around for hours getting very frustrated to try and make it work. I eventually found that by turning my Norton antivirus firewall off and turning on my windows firewall instead, I could open itunes! I don't know if it is just norton antivirus that affects itunes so others might too. Hope this is helpful!

    Sorry, Bill, but there is no way to run iTunes under Windows 98. For just synchronizing tracks with your iPod, you could get a third-party utility such as Anapod, Ephpod, or Xplay for handling the transfer. I haven't used any of these, so I can't make any recommendations. Note that these applications cannot purchase tracks from the iTunes Music Store which is only possible through iTunes.
    I strongly suggest you consider upgrading your version of Windows, though. Windows 98 is no longer supported by Microsoft and it's going to get harder and harder to find applications that will work under 95/98/ME.
    Hope this helps.

  • URGENT help for calling a window from a flash button in a frame not working

    Hello, i'm really desperated, because i can't call a window
    in a frame from flash with the getURL, i tried other but do
    nothing! and something of external something doesn't work too, so
    please can enya tellme what can i do???? i'm using flash 8
    professional, explorer 6, (and let me tell you that i didn't have
    issues before)!!

    chen1 wrote:
    > Hello, i'm really desperated, because i can't call a
    window in a frame from
    > flash with the getURL, i tried other but do nothing! and
    something of external
    > something doesn't work too, so please can enya tellme
    what can i do???? i'm
    > using flash 8 professional, explorer 6, (and let me tell
    you that i didn't have
    > issues before)!!
    Please search the forum, in past weeks I personally replied
    to the very same topic
    few times.
    Search for "Flash Player 9 - broken getURL doesn't open
    specified frame"
    and "Problems with flash navigation in Internet Explorer 7"
    Best Regards
    Urami
    !!!!!!! Merry Christmas !!!!!!!
    Happy New Year
    <urami>
    If you want to mail me - DO NOT LAUGH AT MY ADDRESS
    </urami>

  • Desperately seeking help for displaying image on button

    i wrote the following method to create and display a button with an icon, doesn't work and i cannot figure out what the problem might be and how to fix it, please help me...
    clo :))
    public static void addButton(Container c, String title,
    ActionListener listener)
    JButton button = new JButton(title);
    button.setBorder(null);
    button.setFocusPainted(false);
    button.setBorderPainted(false);
    button.setContentAreaFilled(false);
    ImageIcon icon = new ImageIcon("anImage.jpg");
    button.setIcon(icon);
    c.add(button);
    button.addActionListener(listener);
    the parameter c is of JPanel type and gets added to a JFrame object,
    the source compiles and runs but i see no image on my button, sigh :((!
    PS(the image file is placed in the same dir as the source file).

    Why buttons and labels might not show up the icon?
    Either your image is not in the classpath and you are trying to load it as a resource: see
    http://java.sun.com/docs/books/tutorial/uiswing/misc/icon.html
    or you are running the java machine from a different directory that you expect it does.
    or the file doesn't exist.
    To prove that the system cannot load the image use the example in the above link and the url will be null.
    URL iconURL = ClassLoader.getSystemResource("anImage.jpg");

  • Help for a MS Windows programmer- Unix

    I havent used Unix in ages. Ive since been programming with VB and all the MS-related ballyhoo. Ive done some Java programming in the past, back in the JDK1.1 days. In the last few months ive been digging deep into J2EE as well as Swing. However, all of this development ive been doing has been on NT and Win2K. I need to learn/relearn Unix. Where/how do i start ? Im thinking that i should just load Redhat linux on an old machine i have and have at it. any ideas appreciated.
    mtndood out

    Try this link:
    http://heather.cs.ucdavis.edu/~matloff/unix.html
    for a free online Unix tutorial. I think loading Linux on an old machine is an excelent idea.

  • Create images with dynamic width from 3 images each (left/center/right-part)

    Hello,
    i want to employ a script to create images of dynamic width for me. The whole process shall base on different sized sets of images, which contain a left-image, a right-image and a center-image. The desired width for the different cases shall be reached by duplicating the center-image between the two outer images and placing those images next to each other until the image extends to desired width.
    The layers importet into Photoshop shall be importet as smart-layers (which i already solved).
    Has anyone done something similar already and could give me some useful hints on that issue ?
    I have come up to this until now:
    #target Photoshop
    // =========================== Opens a new document and asks for dimensions ============================
    var myLayerset = File.openDialog ("Select the set of images you want to use!", "*.png",true)
    var myName = prompt("How do you want to call the document?"); // askes for document name
    var width =  prompt("Please insert width for the output here!", ""); // askes for desired width
    var height = prompt("Please insert height for the output here!", ""); //askes for desired height
    var docName = myName +".psd"
    var idMk = charIDToTypeID( "Mk  " );
        var desc3 = new ActionDescriptor();
        var idNw = charIDToTypeID( "Nw  " );
            var desc4 = new ActionDescriptor();
            var idNm = charIDToTypeID( "Nm  " );
            desc4.putString( idNm, """Wunschname""" );
            var idMd = charIDToTypeID( "Md  " );
            var idRGBM = charIDToTypeID( "RGBM" );
            desc4.putClass( idMd, idRGBM );
            var idWdth = charIDToTypeID( "Wdth" );
            var idRlt = charIDToTypeID( "#Rlt" );
            desc4.putUnitDouble( idWdth, idRlt, width );
            var idHght = charIDToTypeID( "Hght" );
            var idRlt = charIDToTypeID( "#Rlt" );
            desc4.putUnitDouble( idHght, idRlt, height );
            var idRslt = charIDToTypeID( "Rslt" );
            var idRsl = charIDToTypeID( "#Rsl" );
            desc4.putUnitDouble( idRslt, idRsl, 72.000000 );
            var idpixelScaleFactor = stringIDToTypeID( "pixelScaleFactor" );
            desc4.putDouble( idpixelScaleFactor, 1.000000 );
            var idFl = charIDToTypeID( "Fl  " );
            var idFl = charIDToTypeID( "Fl  " );
            var idTrns = charIDToTypeID( "Trns" );
            desc4.putEnumerated( idFl, idFl, idTrns );
            var idDpth = charIDToTypeID( "Dpth" );
            desc4.putInteger( idDpth, 8 );
            var idprofile = stringIDToTypeID( "profile" );
            desc4.putString( idprofile, """sRGB IEC61966-2.1""" );
        var idDcmn = charIDToTypeID( "Dcmn" );
        desc3.putObject( idNw, idDcmn, desc4 );
    executeAction( idMk, desc3, DialogModes.NO );
    //==============================================save document================================================
    var idsave = charIDToTypeID( "save" );
        var desc4 = new ActionDescriptor();
        var idAs = charIDToTypeID( "As  " );
            var desc5 = new ActionDescriptor();
            var idmaximizeCompatibility = stringIDToTypeID( "maximizeCompatibility" );
            desc5.putBoolean( idmaximizeCompatibility, true );
        var idPhtthree = charIDToTypeID( "Pht3" );
        desc4.putObject( idAs, idPhtthree, desc5 );
        var idIn = charIDToTypeID( "In  " );
        desc4.putPath( idIn, new File( "C:\\Users\\ target folder goes here" + docName ) );
        var idDocI = charIDToTypeID( "DocI" );
        desc4.putInteger( idDocI, 308 );
        var idsaveStage = stringIDToTypeID( "saveStage" );
        var idsaveStageType = stringIDToTypeID( "saveStageType" );
        var idsaveSucceeded = stringIDToTypeID( "saveSucceeded" );
        desc4.putEnumerated( idsaveStage, idsaveStageType, idsaveSucceeded );
    executeAction( idsave, desc4, DialogModes.NO );
    //========================================================================================================
    for (var i = 0; i < myLayerset.length; i++) {
    if (myLayerset[i] instanceof File && myLayerset[i].hidden == false) {
    // ======================================================= opens selected images as smart objects====================
    var idOpn = charIDToTypeID( "Opn " );
        var desc1 = new ActionDescriptor();
        var idnull = charIDToTypeID( "null" );
       desc1.putPath( idnull, myLayerset[i]);
        var idsmartObject = stringIDToTypeID( "smartObject" );
        desc1.putBoolean( idsmartObject, true );
    executeAction( idOpn, desc1, DialogModes.NO );
    //===================================duplicates opened layer into created document========================================
    var idDplc = charIDToTypeID( "Dplc" );
        var desc144 = new ActionDescriptor();
        var idnull = charIDToTypeID( "null" );
            var ref135 = new ActionReference();
            var idLyr = charIDToTypeID( "Lyr " );
            var idOrdn = charIDToTypeID( "Ordn" );
            var idTrgt = charIDToTypeID( "Trgt" );
            ref135.putEnumerated( idLyr, idOrdn, idTrgt );
        desc144.putReference( idnull, ref135 );
        var idT = charIDToTypeID( "T   " );
            var ref136 = new ActionReference();
            var idDcmn = charIDToTypeID( "Dcmn" );
            ref136.putName( idDcmn, docName); 
        desc144.putReference( idT, ref136 );
        var idVrsn = charIDToTypeID( "Vrsn" );
        desc144.putInteger( idVrsn, 5 );
    executeAction( idDplc, desc144, DialogModes.NO );
    // ======================================================= close tab without saving ==========
    var idCls = charIDToTypeID( "Cls " );
        var desc156 = new ActionDescriptor();
        var idSvng = charIDToTypeID( "Svng" );
        var idYsN = charIDToTypeID( "YsN " );
        var idN = charIDToTypeID( "N   " );
        desc156.putEnumerated( idSvng, idYsN, idN );
    executeAction( idCls, desc156, DialogModes.NO );

    I adapted a Script somewhat, so you may give this a test.
    But it uses the open file so you would have to adapt it further.
    // arranges the selected jpg, tif, psd in line;
    // gutters may be irregular due to rounding effects;
    // thanks to michael l hale and muppet mark;
    // for mac and CS6;
    // 2014, use it at your own risk;
    #target photoshop
    if (app.documents.length == 0) {
              var myDocument = app.documents.add(UnitValue (300, "mm"), UnitValue (50, "mm"), 300, "new", NewDocumentMode.RGB, DocumentFill.TRANSPARENT)
    else {myDocument = app.activeDocument};
    // set to pixels;
    var originalRulerUnits = app.preferences.rulerUnits;
    app.preferences.rulerUnits = Units.PIXELS;
    var theArray = [0, 0, myDocument.width, myDocument.height];
    // select files;
    if ($.os.search(/windows/i) != -1) {var theFiles = File.openDialog ("please select files", '*.jpg;*.tif;*.pdf;*.psd', true)}
    else {var theFiles = File.openDialog ("please select exactly three files", getFiles, true)};
    // do the arrangement
    if (theFiles) {placeInLines (myDocument, theFiles, theArray)}
    app.preferences.rulerUnits = originalRulerUnits;
    ////// function to place images in lines //////
    function placeInLines (myDocument, theFiles, theArray) {
    theFiles.sort();
    // fit on screen;
    var idslct = charIDToTypeID( "slct" );
    var desc64 = new ActionDescriptor();
    var idnull = charIDToTypeID( "null" );
    var ref44 = new ActionReference();
    var idMn = charIDToTypeID( "Mn  " );
    var idMnIt = charIDToTypeID( "MnIt" );
    var idFtOn = charIDToTypeID( "FtOn" );
    ref44.putEnumerated( idMn, idMnIt, idFtOn );
    desc64.putReference( idnull, ref44 );
    executeAction( idslct, desc64, DialogModes.NO );
    // change pref;
    var originalRulerUnits = app.preferences.rulerUnits;
    app.preferences.rulerUnits = Units.PIXELS;
    setToAccelerated();
    app.togglePalettes();
    var check = turnOffRescale ();
    // create the arrangement;
    if (theFiles.length > 0 && theFiles.length == 3) {
    myDocument.activeLayer = myDocument.layers[0];
    // create masked group;
    var theGroup = myDocument.layerSets.add();
    theGroup.name = "arrangement";
    // determine the array’s values;
    var areaWidth = theArray[2] - theArray[0];
    var areaHeight = theArray[3] - theArray[1];
    var theDocResolution = myDocument.resolution;
    var areaRelation = areaHeight / areaWidth;
    // center of placed non-pdf images;
    var centerX = Number(myDocument.width / 2);
    var centerY = Number(myDocument.height / 2);
    // suppress dialogs;
    var theDialogSettings = app.displayDialogs;
    app.displayDialogs = DialogModes.NO;
    var pdfSinglePages = new Array;
    var nonPDFs = new Array;
    var theDimPDFs = new Array;
    var theLength = 0;
    // collect the files’ measurements;
    var theDimensions = new Array;
    var theLengths = new Array;
    // array to collect both files and placed pdf-pages;
    var theseFiles = new Array;
    var theLength = 0;
    // collect the files’ measurements;
    for (var o = 0; o < theFiles.length; o++) {
        var thisFile = theFiles[o];
              theseFiles.push(thisFile);
              var theDim = getDimensions(thisFile);
              theDimensions.push(theDim);
              theRelativeWidth = 100 / theDim[1] * theDim[0];
              theLength = theLength + theRelativeWidth;
    // reset dialogmodes;
    app.displayDialogs = DialogModes.ERROR;
    // if three files;
    if (theseFiles.length == 3) {
    // create the layers;
    var theNumber = 0;
    var theAdded = 0;
    var y = areaHeight / 2;
    // add placed image’s width;
    var thisLineWidth = 0 + theAdded;
    var theLastFactor = Number (Number(myDocument.height) / theDimensions[2][1] * theDimensions[2][2] / theDocResolution * 100);
    var theLastWidth = Math.round(theDimensions[2][0] * theLastFactor / 100 * theDocResolution / theDimensions[2][2]);
    // place the files;
    for (var x = 0; x < 3; x++) {
    var theNumber = x;
    var thisFile = theseFiles[theNumber];
    var theFactor = Number (Number(myDocument.height) / theDimensions[theNumber][1] * theDimensions[theNumber][2] / theDocResolution * 100);
    var theNewWidth = Math.round(theDimensions[theNumber][0] * theFactor / 100 * theDocResolution / theDimensions[theNumber][2]);
    var offsetX = theNewWidth / 2 + thisLineWidth - centerX + theArray[0];
    var offsetY = y - centerY + theArray[1];
    var theLayer = placeScaleFile (thisFile, offsetX, offsetY, theFactor, theFactor);
    myDocument.activeLayer.move(theGroup, ElementPlacement.PLACEATBEGINNING);
    thisLineWidth = thisLineWidth + theNewWidth;
    // duplicate the middle one;
    if (theNumber == 1) {
              while (thisLineWidth < myDocument.width - theLastWidth) {
                        theLayer = duplicateAndOffset (theLayer, theNewWidth, 0);
                        thisLineWidth = thisLineWidth + theNewWidth;
    // reset;
    app.togglePalettes();
    turnOnRescale (check);
    app.preferences.rulerUnits = originalRulerUnits;
    ////// playback to accelerated //////
    function setToAccelerated () {
              var idsetd = charIDToTypeID( "setd" );
              var desc1 = new ActionDescriptor();
              var idnull = charIDToTypeID( "null" );
                        var ref1 = new ActionReference();
                        var idPrpr = charIDToTypeID( "Prpr" );
                        var idPbkO = charIDToTypeID( "PbkO" );
                        ref1.putProperty( idPrpr, idPbkO );
                        var idcapp = charIDToTypeID( "capp" );
                        var idOrdn = charIDToTypeID( "Ordn" );
                        var idTrgt = charIDToTypeID( "Trgt" );
                        ref1.putEnumerated( idcapp, idOrdn, idTrgt );
              desc1.putReference( idnull, ref1 );
              var idT = charIDToTypeID( "T   " );
                        var desc2 = new ActionDescriptor();
                        var idperformance = stringIDToTypeID( "performance" );
                        var idperformance = stringIDToTypeID( "performance" );
                        var idaccelerated = stringIDToTypeID( "accelerated" );
                        desc2.putEnumerated( idperformance, idperformance, idaccelerated );
              var idPbkO = charIDToTypeID( "PbkO" );
              desc1.putObject( idT, idPbkO, desc2 );
              executeAction( idsetd, desc1, DialogModes.NO );
    ////// get psds, tifs and jpgs from files //////
    function getFiles (theFile) {
        if (theFile.name.match(/\.(jpg|tif|psd|pdf|)$/i)) {
            return true
    ////// place //////
    function placeScaleFile (file, xOffset, yOffset, theScale) {
    // =======================================================
    var idPlc = charIDToTypeID( "Plc " );
        var desc5 = new ActionDescriptor();
        var idnull = charIDToTypeID( "null" );
        desc5.putPath( idnull, new File( file ) );
        var idFTcs = charIDToTypeID( "FTcs" );
        var idQCSt = charIDToTypeID( "QCSt" );
        var idQcsa = charIDToTypeID( "Qcsa" );
        desc5.putEnumerated( idFTcs, idQCSt, idQcsa );
        var idOfst = charIDToTypeID( "Ofst" );
            var desc6 = new ActionDescriptor();
            var idHrzn = charIDToTypeID( "Hrzn" );
            var idPxl = charIDToTypeID( "#Pxl" );
            desc6.putUnitDouble( idHrzn, idPxl, xOffset );
            var idVrtc = charIDToTypeID( "Vrtc" );
            var idPxl = charIDToTypeID( "#Pxl" );
            desc6.putUnitDouble( idVrtc, idPxl, yOffset );
        var idOfst = charIDToTypeID( "Ofst" );
        desc5.putObject( idOfst, idOfst, desc6 );
        var idWdth = charIDToTypeID( "Wdth" );
        var idPrc = charIDToTypeID( "#Prc" );
        desc5.putUnitDouble( idWdth, idPrc, theScale );
        var idHght = charIDToTypeID( "Hght" );
        var idPrc = charIDToTypeID( "#Prc" );
        desc5.putUnitDouble( idHght, idPrc, theScale );
        var idLnkd = charIDToTypeID( "Lnkd" );
        desc5.putBoolean( idLnkd, true );
    executeAction( idPlc, desc5, DialogModes.NO );
    return myDocument.activeLayer;
    ////// open pdf //////
    function openPDF (theImage, x) {
    // define pdfopenoptions;
    var pdfOpenOpts = new PDFOpenOptions;
    pdfOpenOpts.antiAlias = true;
    pdfOpenOpts.bitsPerChannel = BitsPerChannelType.EIGHT;
    pdfOpenOpts.cropPage = CropToType.TRIMBOX;
    pdfOpenOpts.mode = OpenDocumentMode.CMYK;
    pdfOpenOpts.resolution = 10;
    pdfOpenOpts.suppressWarnings = true;
    pdfOpenOpts.usePageNumber  = true;
    // suppress dialogs;
    var theDialogSettings = app.displayDialogs;
    app.displayDialogs = DialogModes.NO;
    pdfOpenOpts.page = x;
    var thePdf = app.open(theImage, pdfOpenOpts);
    thePdf.close(SaveOptions.DONOTSAVECHANGES);
    // reset dialogmodes;
    app.displayDialogs = theDialogSettings;
    ////// turn off preference to scale placed image //////
    function turnOffRescale () {
    // determine if the resize prefernce is on;
    var ref = new ActionReference();
    ref.putEnumerated( charIDToTypeID("capp"), charIDToTypeID("Ordn"), charIDToTypeID("Trgt") );
    var appDesc = executeActionGet(ref);
    var prefDesc = appDesc.getObjectValue(charIDToTypeID( "GnrP" ));
    var theResizePref = prefDesc.getBoolean(stringIDToTypeID( "resizePastePlace" ));
    // turn off resize image during place;
    if (theResizePref == true);{
    // =======================================================
    var idsetd = charIDToTypeID( "setd" );
        var desc12 = new ActionDescriptor();
        var idnull = charIDToTypeID( "null" );
            var ref4 = new ActionReference();
            var idPrpr = charIDToTypeID( "Prpr" );
            var idGnrP = charIDToTypeID( "GnrP" );
            ref4.putProperty( idPrpr, idGnrP );
            var idcapp = charIDToTypeID( "capp" );
            var idOrdn = charIDToTypeID( "Ordn" );
            var idTrgt = charIDToTypeID( "Trgt" );
            ref4.putEnumerated( idcapp, idOrdn, idTrgt );
        desc12.putReference( idnull, ref4 );
        var idT = charIDToTypeID( "T   " );
            var desc13 = new ActionDescriptor();
            var idresizePastePlace = stringIDToTypeID( "resizePastePlace" );
            desc13.putBoolean( idresizePastePlace, false );
        var idGnrP = charIDToTypeID( "GnrP" );
        desc12.putObject( idT, idGnrP, desc13 );
    executeAction( idsetd, desc12, DialogModes.NO );
    return theResizePref
    ////// turn on preference to scale plced image //////
    function turnOnRescale (check) {
    if (check == true) {
    // =======================================================
    var idsetd = charIDToTypeID( "setd" );
        var desc14 = new ActionDescriptor();
        var idnull = charIDToTypeID( "null" );
            var ref5 = new ActionReference();
            var idPrpr = charIDToTypeID( "Prpr" );
            var idGnrP = charIDToTypeID( "GnrP" );
            ref5.putProperty( idPrpr, idGnrP );
            var idcapp = charIDToTypeID( "capp" );
            var idOrdn = charIDToTypeID( "Ordn" );
            var idTrgt = charIDToTypeID( "Trgt" );
            ref5.putEnumerated( idcapp, idOrdn, idTrgt );
        desc14.putReference( idnull, ref5 );
        var idT = charIDToTypeID( "T   " );
            var desc15 = new ActionDescriptor();
            var idresizePastePlace = stringIDToTypeID( "resizePastePlace" );
            desc15.putBoolean( idresizePastePlace, true );
        var idGnrP = charIDToTypeID( "GnrP" );
        desc14.putObject( idT, idGnrP, desc15 );
    executeAction( idsetd, desc14, DialogModes.NO );
    ////// convert to so if not one aready //////
    function duplicateAndOffset (theLayer, theXOffset, theYOffset) {
    app.activeDocument.activeLayer = theLayer;
    // =======================================================
    var idcopy = charIDToTypeID( "copy" );
        var desc9 = new ActionDescriptor();
        var idnull = charIDToTypeID( "null" );
            var ref5 = new ActionReference();
            var idLyr = charIDToTypeID( "Lyr " );
            var idOrdn = charIDToTypeID( "Ordn" );
            var idTrgt = charIDToTypeID( "Trgt" );
            ref5.putEnumerated( idLyr, idOrdn, idTrgt );
        desc9.putReference( idnull, ref5 );
        var idT = charIDToTypeID( "T   " );
            var desc10 = new ActionDescriptor();
            var idHrzn = charIDToTypeID( "Hrzn" );
            var idRlt = charIDToTypeID( "#Pxl" );
            desc10.putUnitDouble( idHrzn, idRlt, theXOffset );
            var idVrtc = charIDToTypeID( "Vrtc" );
            var idRlt = charIDToTypeID( "#Pxl" );
            desc10.putUnitDouble( idVrtc, idRlt, theYOffset );
        var idOfst = charIDToTypeID( "Ofst" );
        desc9.putObject( idT, idOfst, desc10 );
    executeAction( idcopy, desc9, DialogModes.NO );
    return app.activeDocument.activeLayer
    ////// load pdf as smart object //////
    function transformLayer (layer, percentage, xOffset, yOffset) {
    app.activeDocument.activeLayer = layer;
    // =======================================================
    var idTrnf = charIDToTypeID( "Trnf" );
        var desc4 = new ActionDescriptor();
        var idFTcs = charIDToTypeID( "FTcs" );
        var idQCSt = charIDToTypeID( "QCSt" );
        var idQcsa = charIDToTypeID( "Qcsa" );
        desc4.putEnumerated( idFTcs, idQCSt, idQcsa );
        var idOfst = charIDToTypeID( "Ofst" );
            var desc5 = new ActionDescriptor();
            var idHrzn = charIDToTypeID( "Hrzn" );
            var idPxl = charIDToTypeID( "#Pxl" );
            desc5.putUnitDouble( idHrzn, idPxl, xOffset );
            var idVrtc = charIDToTypeID( "Vrtc" );
            var idPxl = charIDToTypeID( "#Pxl" );
            desc5.putUnitDouble( idVrtc, idPxl, yOffset );
        var idOfst = charIDToTypeID( "Ofst" );
        desc4.putObject( idOfst, idOfst, desc5 );
        var idWdth = charIDToTypeID( "Wdth" );
        var idPrc = charIDToTypeID( "#Prc" );
        desc4.putUnitDouble( idWdth, idPrc, percentage );
        var idHght = charIDToTypeID( "Hght" );
        var idPrc = charIDToTypeID( "#Prc" );
        desc4.putUnitDouble( idHght, idPrc, percentage );
        var idLnkd = charIDToTypeID( "Lnkd" );
        desc4.putBoolean( idLnkd, true );
        var idAntA = charIDToTypeID( "AntA" );
        desc4.putBoolean( idAntA, true );
    executeAction( idTrnf, desc4, DialogModes.NO );
    return app.activeDocument.activeLayer
    ////// function to get file’s dimensions, thanks to michael l hale //////
    function getDimensions( file ){
    function divideString (theString) {
              theString = String(theString);
        var a = Number(theString.slice(0, theString.indexOf("\/")));
        var b = Number(theString.slice(theString.indexOf("\/") + 1));
        return (a / b)
    // from a script by michael l hale;
    function loadXMPLibrary(){
         if ( !ExternalObject.AdobeXMPScript ){
              try{
                   ExternalObject.AdobeXMPScript = new ExternalObject
                                                                ('lib:AdobeXMPScript');
              }catch (e){
                   alert( ErrStrs.XMPLIB );
                   return false;
         return true;
    function unloadXMPLibrary(){
       if( ExternalObject.AdobeXMPScript ) {
          try{
             ExternalObject.AdobeXMPScript.unload();
             ExternalObject.AdobeXMPScript = undefined;
          }catch (e){
             alert( ErrStrs.XMPLIB );
    ////// based on a script by muppet mark //////
    function dimensionsShellScript (file) {
              try {
    // getMetaDataMDLS;
    if (File(file) instanceof File && File(file).exists) {
              var shellString = "/usr/bin/mdls ";
              shellString += File(file).fsName;
    //          shellString += File(file).fullName;
              shellString += ' > ~/Documents/StdOut2.txt';
              app.system(shellString);
    // read the file;
    if (File('~/Documents/StdOut2.txt').exists == true) {
        var file = File('~/Documents/StdOut2.txt');
        file.open("r");
        file.encoding= 'BINARY';
        var theText = new String;
        for (var m = 0; m < file.length; m ++) {
                        theText = theText.concat(file.readch());
              file.close();
              theText = theText.split("\n");
    // get the dimensions;
              var dim = new Array;
              for (var m = 0; m < theText.length; m++) {
                        var theLine = theText[m];
                        if (theLine.indexOf("kMDItemPixelWidth") != -1) {dim.push(theLine.match(/[\d\.]+/g).join("") )}
                        if (theLine.indexOf("kMDItemPixelHeight") != -1) {dim.push(theLine.match(/[\d\.]+/g).join("") )}
                        if (theLine.indexOf("kMDItemResolutionWidthDPI") != -1) {dim.push(theLine.match(/[\d\.]+/g).join("") )}
                        if (theLine.indexOf("kMDItemResolutionHeightDPI") != -1) {dim.push(theLine.match(/[\d\.]+/g).join("") )}
    // remove file and hand back;
              File('~/Documents/StdOut2.txt').remove();
    catch (e) {
              if (File('~/Documents/StdOut2.txt').exists == true) {File('~/Documents/StdOut2.txt').remove()};
              return dim
              try{
                        loadXMPLibrary();
                        var xmpf = new XMPFile( file.fsName, XMPConst.UNKNOWN, XMPConst.OPEN_FOR_READ );
                        var xmp = xmpf.getXMP();
                        xmpf.closeFile();
                        var resolutionUnit = xmp.getProperty( XMPConst.NS_TIFF, 'ResolutionUnit', XMPConst.STRING);
                        var resFactor = 1;
                        if (resolutionUnit == 2) {
                                  var resFactor = 1;
                        if (resolutionUnit == 3) {
                                  var resFactor = 2.54;
                        var dim = [xmp.getProperty( XMPConst.NS_EXIF, 'PixelXDimension', XMPConst.STRING),
                        xmp.getProperty( XMPConst.NS_EXIF, 'PixelYDimension', XMPConst.STRING),
                        divideString (xmp.getProperty( XMPConst.NS_TIFF, 'XResolution', XMPConst.STRING)) * resFactor,
                        divideString (xmp.getProperty( XMPConst.NS_TIFF, 'YResolution', XMPConst.STRING)) * resFactor];
                        unloadXMPLibrary();
                        if(dim[0]=="undefined" || dim[1]=="undefined"){
                var dim = undefined;
                var res = undefined;
                var bt = new BridgeTalk;
                bt.target = "bridge";
                var myScript = ("var ftn = " + psRemote.toSource() + "; ftn("+file.toSource()+");");
                bt.body = myScript;
                bt.onResult = function( inBT ) {myReturnValue(inBT.body); }
                bt.send(10);
                        function myReturnValue(str){
                                  res = str;
                                  dim = str.split(',');
                        function psRemote(file){
                                  var t= new Thumbnail(file);
                                  return t.core.quickMetadata.width+','+t.core.quickMetadata.height;
        }catch(e){unloadXMPLibrary()};
              if (String(dim[2]).indexOf("\/") != -1) {
                        var a = divideString(dim[2]);
                        var b = divideString(dim[3]);
                        dim = [dim[0], dim[1], a, b]
    // if dimensions are missing as might be the case with some bitmap tiffs for example try a shell-script;
              if (dim[0] == undefined || dim[1] == undefined) {
                        var array = dimensionsShellScript(file);
                        dim = array;
    // if shell-string failed open doc to get measurements;
              if (dim[0] == undefined || dim[1] == undefined) {
                        var thisDoc = app.open (File(file));
    // close ai without saving;
                        if (file.name.slice(-3).match(/\.(ai)$/i)) {
                                  thisDoc.trim(TrimType.TRANSPARENT);
                                  var dim = [thisDoc.width, thisDoc.height, thisDoc.resolution, thisDoc.resolution];
                                  thisDoc.close(SaveOptions.DONOTSAVECHANGES)
                        else {
                                  var dim = [thisDoc.width, thisDoc.height, thisDoc.resolution, thisDoc.resolution];
                                  thisDoc.close(SaveOptions.PROMPTTOSAVECHANGES)
    return dim;

  • How do I convert my Windows 7 Folder to an ISO image to burn to a USB, in order to use Bootcamp Assistant to partition my MacBook Pro for Mac and Windows?

    How do I convert my Windows 7 Folder to an ISO image to burn to my  USB Flash drive (16GB)  in order to use Bootcamp Assistant to partition my MacBook Pro for Mac and Windows?

    Sorry - confusing - My question has NOT been solved yet - can anyone help?

  • Insufficient Data for an Image Acrobat Pro 11.0.6 - Windows 8.1

    We have recently upgraded several users in our office to Windows 8.1.  They are running Acrobat Pro 11.0.6, which they had previously been running Windows 7 without issue.
    Now, in Windows 8, they will have a PDF file open and pages in it start to go blank followed by the "insufficient data for an image" error.  It seems that this may be related to having a downloaded PDF file open in another window, or making comments in a PDF file. 
    Has anyone else run into this?  Any suggestions on what to do?  We've uninstalled/reinstalled, run a cleaner tool, etc... to no avail.  The other suggest Adobe has had so far is to change the zoom on the file; that did not resolve it either. 

    We are having the same issue.  I've tried the newest version of Acrobat (11.0.6) on windows 7, and windows 8.1.   I've also tried earlier version of acrobat (9 & 10) fully updated.  So far I have found 2 pdf's that consistently cause the "Insufficient data for an image." error.  The pdf i've been using to test is located here   (http://japoncaogreniyorum.files.wordpress.com/2010/08/lets_learn_japanese_basic_ii_1_of_2. pdf)  If i open that pdf in acrobat 11.0.6 i get the error right away.  If i open that same pdf in chrome it opens with no errors and looks as it should.  No missing pages, half pages, or blank pages.  The second pdf i've been testing this with is confidential but it has yielded the same results.  Regardless of the version of acrobat i open the pdf's in i get the error.  In chrome they display and print with no errors.
    Again this is tested with Acrobat 11.0.6 on Windows 7 & 8.1.  This is the version cited by adobe to fix this very problem.
    Any help is much appreciated

  • Wireless printer sharing- Verizon only has automated help-or any help- for windows. i have a mac.

    i have a new Brother 490CW which instructs me to "push the WiFi protected set up button" on the router. the Verizon supplied router Ultraline series only has on/off power button.  Verizon's help is abysmal.  The automated response sends me back the the help for windows.  can anyone tell me how to set up this printer as wireless?
    thanks.

    Pretty good directions here : http://www.brother-usa.com/support/wireless/Step1.​aspx?ProductID=MFC-490CW
    You'll find the SSID (ESSID) + WEP key on a sticker on the Verizon-supplied router.
    Kevin
    Verizon Telecom
    Fiber Solution Center
    Notice: Content posted by Verizon employees is meant to be informational and does not supercede or change the Verizon Forums User Guidelines or Terms or Service, or your Customer Agreement Terms and Conditions or Plan.

  • Help for downloading/installing PSE13 with window 8.1?

    I get this message after intall attempts ..."Installer has detected that a machine restart may be pending. Its recommended that you quit the installer, restart your machine and try installing again,"  Lightroom, however, installed fine.

    Thank you for responding.  I got some advice from a Microsoft forum....it worked.  Thanks again.
          From: Pat Willener <[email protected]>
    To: kathryn kramar <[email protected]>
    Sent: Saturday, January 3, 2015 10:56 PM
    Subject:  help for downloading/installing PSE13 with window 8.1?
    help for downloading/installing PSE13 with window 8.1?
    created by Pat Willener in Downloading, Installing, Setting Up - View the full discussion
    pwillener wrote: What is your operating system?
    Sorry, you specified Windows 8.1 in the subject line. If the reply above answers your question, please take a moment to mark this answer as correct by visiting: https://forums.adobe.com/message/7063274#7063274 and clicking ‘Correct’ below the answer 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: Please note that the Adobe Forums do not accept email attachments. If you want to embed an image in your message please visit the thread in the forum and click the camera icon: https://forums.adobe.com/message/7063274#7063274 To unsubscribe from this thread, please visit the message page at , click "Following" at the top right, & "Stop Following" 
    Start a new discussion in Downloading, Installing, Setting Up by email or at Adobe Community For more information about maintaining your forum email notifications please go to https://forums.adobe.com/thread/1516624.

  • I am using Adobe Pro 11 and on opening a pdf I am getting error 'Insufficient Data for an Image'. Please help and provide a workaround if the solution not there.

    Hi all,
    I am using Adobe Pro 11 and on opening a pdf I am getting error 'Insufficient Data for an Image'. Please help and provide a workaround if the solution not there.
    I have already set the preferences to for page view to low zoom settings, and page fit view settings, but it never opens the pdf. Please check and provide a solution asap.
    Thanks in advance!

    Most of the documents have sensitive info on them.  I will have to do some looking for some that i can share, but will get something to upload (dropbox) as soon as I can.
    Thanks for you help.

  • I need some help resizing my images on PS6. I am using a mac and have been trying to resize with same resolution and constaining proportions but for some reaseon the smaller resized image appears pizelated.

    I need some help resizing my images on PS6. I am using a mac and have been trying to resize with same resolution and constaining proportions but for some reaseon the smaller resized image appears pizelated. Heres an image of before and after. The first image I use is a JPG 72dpi 1500px x1500px and I want to downsize it to 600x600px same res, but it keeps pixelating, this has never happened before. Any suggestions, thoughts?
    thanks!

    I wouldn't say pixelated; more like blurry.
    Like ConnectedCreative said, what steps are you using? Are you using "bicubic sharper" when resizing down?

Maybe you are looking for