function drawMycrograph(ddata){
  var canvas = document.getElementById("canvasSimplePhoto");
  var length;
  var context;

  data = JSON.parse(ddata);

//  context.scale(0.5,0.5);
  if(!canvas || !canvas.getContext){
    return(false);
  }
  else if(canvas.getContext){
      context=canvas.getContext('2d')
    }
    console.log(data);
  length = data.length;
  console.log(length);
  var imgData = context.createImageData(length,length);

  for (var i=0;i<length;i++){
    for (var j=0;j<length;j++){
      var n = j*4+i*length*4;
      var pixel = data[i][j];
      imgData.data[n]   = pixel;
      imgData.data[n+1] = pixel;
      imgData.data[n+2] = pixel;
      imgData.data[n+3] = 255;
    }
  }
  context.putImageData(imgData, 0, 0);

}
