1
$\begingroup$

I am trying to import and display this image in Mathematica (v10.0.2)

https://dl.dropboxusercontent.com/u/35018860/test.tiff

however I did not succeed. Any idea?

$\endgroup$
2
  • $\begingroup$ I think the problem is from your image (unable to open in any image editor), not the Import $\endgroup$
    – Valacar
    Dec 20, 2016 at 9:27
  • $\begingroup$ @Valacar You are right. It can not be opened with a 'normal' image editor/viewer but you can open it with saxsgui.com . Maybe the problem is finding out the right file encoding format? Can this be done in Mathematica? $\endgroup$
    – Luigi
    Dec 20, 2016 at 12:15

1 Answer 1

2
$\begingroup$

I can open this image with mma 11.0.1.

image = Import [
  "https://dl.dropboxusercontent.com/u/35018860/test.tiff"];

Options[image, MetaInformation]

The image info is:

{MetaInformation -> <|"Exif" -> <|"NewSubfileType" -> "Primary image",
      "ImageWidth" -> 487, "ImageLength" -> 619, 
     "BitsPerSample" -> 32, "Compression" -> "Uncompressed", 
     "PhotometricInterpretation" -> "Black Is Zero", 
     "ImageDescription" -> "# Pixel_size 172e-6 m x 172e-6 m

      # Silicon sensor, thickness 0.000320 m

      # Exposure_time 4800.000000 s

      # Exposure_period 4832.000000 s

      # Tau = 383.8e-09 s

      # Count_cutoff 1077896 counts

      # Threshold_setting: 4024 eV

      # Gain_setting: high gain (vrf = -0.150)

      # N_excluded_pixels = 14

      # Excluded_pixels: badpix_mask.tif

      # Flat_field: (nil)

      # Trim_file: p300k0149_E8048_T4024_vrf_m0p15.bin

      # Image_path: /data/datatemp/

      # Ratecorr_lut_directory: (nil)

      # Retrigger_mode: 0", 
     "Model" -> "PILATUS 300K-20Hz, S/N 3-0149-20Hz", 
     "StripOffsets" -> 5988, "RowsPerStrip" -> 619, 
     "StripByteCounts" -> 1205812, "XResolution" -> 88, 
     "YResolution" -> 88, "Software" -> "TVX TIFF v 1.3", 
     "DateTime" -> 
      DateObject[{2016, 12, 7}, 
       TimeObject[{18, 2, 22.}, TimeZone -> 1.], TimeZone -> 1.], 
     "Artist" -> 
      "<?xml version= 1.0  ?><SAXSLABparameters><param name= \
det_pixel_size >172e-6 172e-6</param><param name= det_thickness \
>0.000320</param><param name= det_exposure_time \
>4800.000000</param><param name= det_exposure_period \
>4832.000000</param><param name= det_tau >383.8e-09</param><param \
name= det_count_cutoff >1077896</param><param name= \
det_threshold_setting >4024</param><param name= det_n_excluded_pixels \
>14</param><param name= det_excluded_pixels \
>badpix_mask.tif</param><param name= det_flat_field \
>(nil)</param><param name= det_trim_directory \
>p300k0149_E8048_T4024_vrf_m0p15.bin</param><param name= datatype \
>tiff</param><param name= detectortype >PILATUS 300K</param><param \
name= detector_sn >dec427</param><param name= meastype \
></param><param name= start_timestamp >Wed Dec 07 18:15:24 \
2016</param><param name= end_timestamp ></param><param name= \
save_timestamp ></param><param name= realtime ></param><param name= \
livetime >4800.00</param><param name= pixelsize >0.172 \
0.172</param><param name= beamcenter_nominal >364.80    \
209.50</param><param name= beamcenter_actual >364.82    \
209.47</param><param name= data_mean ></param><param name= data_min \
></param><param name= data_max ></param><param name= data_rms \
></param><param name= data_p10 ></param><param name= data_p90 \
></param><param name= calibrationtype >geom</param><param name= kcal \
></param><param name= pixelcal ></param><param name= koffset \
></param><param name= wavelength >1.5418</param><param name= \
detector_dist >1075.0010</param><param name= saxsconf_r1 \
>0.2000</param><param name= saxsconf_r2 >2.0000</param><param name= \
saxsconf_r3 >0.1250</param><param name= saxsconf_l1 \
>725</param><param name= saxsconf_l2 >400</param><param name= \
saxsconf_l3 >200</param><param name= detector_dist \
>1075.0010</param><param name= saxsconf_wavelength \
>1.5418</param><param name= saxsconf_dwavelength >0.004</param><param \
name= saxsconf_Imon ></param><param name= saxsconf_Ieff \
>1.12500</param><param name= saxsconf_Izero ></param><param name= \
saxsconf_det_offx >0</param><param name= saxsconf_det_offy \
>0</param><param name= saxsconf_det_rotx >0</param><param name= \
saxsconf_det_roty >0</param><param name= saxsconf_det_pixsizez \
>0.172</param><param name= saxsconf_det_pixsizey >0.172</param><param \
name= saxsconf_det_resx_0 ></param><param name= saxsconf_det_resy_0 \
></param><param name= saxsconf_abs_int_fact ></param><param name= \
sample_transfact ></param><param name= sample_thickness \
></param><param name= sample_ypos >25.000</param><param name= \
sample_zpos >33.600</param><param name= sample_angle1 \
>0.800</param><param name= sample_angle2 ></param><param name= \
sample_angle3 ></param><param name= sample_temp ></param><param name= \
sample_pressure ></param><param name= sample_strain ></param><param \
name= sample_stress ></param><param name= sample_shear_rate \
></param><param name= sample_concentration ></param><param name= \
sample_buffer ></param><param name= sample_ID ></param><param name= \
hg1 >0.399987</param><param name= hp1 >-0.001080</param><param name= \
vg1 >0.399987</param><param name= vp1 >-0.079647</param><param name= \
hg2 >4.000000</param><param name= hp2 >-0.000000</param><param name= \
vg2 >4.000000</param><param name= vp2 >0.000009</param><param name= \
hg3 >0.250000</param><param name= hp3 >-0.035193</param><param name= \
vg3 >0.250000</param><param name= vp3 >0.023757</param><param name= \
ysam >25.000000</param><param name= zsam >33.600001</param><param \
name= thsam >0.799996</param><param name= detx \
>950.001025</param><param name= dety >-1.169281</param><param name= \
detz >0.946257</param><param name= bstop >37.551200</param><param \
name= pd >30.000000</param><param name= source_type \
>GENIX3D</param><param name= source_runningtime ></param><param name= \
source_kV >49.93</param><param name= source_ma >0.60</param><param \
name= xaxis ></param><param name= xaxisfull ></param><param name= \
yaxis ></param><param name= error_norm_fact >1</param><param name= \
xaxisbintype >lin</param><param name= log >log</param><param name= \
reduction_type >s</param><param name= reduction_state ></param><param \
name= raw_filename ></param><param name= bsmask_configuration >0    \
364.80    209.50 15.0    205.00  7.5</param><param name= \
mask_filename ></param><param name= flatfield_filename \
></param><param name= empty_filename ></param><param name= \
solvent_filename ></param><param name= darkcurrent_filename \
></param><param name= readoutnoise_filename ></param><param name= \
zinger_removal >0</param><param name= data_added_constant \
>0</param><param name= data_multiplied_constant >1</param><param \
name= Img.Class ></param><param name= Img.MonitorMethod \
></param><param name= Img.ImgType >2D</param><param name= Img.Site \
>TUM</param><param name= Img.Group ></param><param name= \
Img.Researcher ></param><param name= Img.Operator ></param><param \
name= Img.Administrator ></param><param name= Meas.Description >B2: \
1554 Dec \[Lambda]=1; conf 23, Time= \
4800</param></SAXSLABparameters>", 
     "SampleFormat" -> "Two's complement signed integer data", 
     "DateTimeOriginal" -> Missing["Disputed"]|>|>}

Histogram:

imageGray = ColorConvert[image, "Grayscale"];

Histogram[Flatten@ImageData[imageGray], 1000000, PlotRange -> All, 
 ScalingFunctions -> {"Log", "Log"}]

enter image description here

Image@Rescale[ImageData@image, {10^-9, 10^-6}, {0.2, 1}]

enter image description here

or:

imageData = ImageData[imageGray];

{min, max} = MinMax[imageData];

Image[(imageData - min)/(max - min)*255]

enter image description here

$\endgroup$
6
  • $\begingroup$ it does not work on my system Mathematica v10.0.2. Any idea what goes wrong? $\endgroup$
    – Luigi
    Dec 20, 2016 at 21:15
  • $\begingroup$ What is the result after Options[image, MetaInformation]? Which OS are you using? $\endgroup$
    – mrz
    Dec 20, 2016 at 21:50
  • $\begingroup$ {MetaInformation -> {}} and windows 7 enterprise $\endgroup$
    – Luigi
    Dec 20, 2016 at 21:51
  • $\begingroup$ Can you see the image after image = Import [ "https://dl.dropboxusercontent.com/u/35018860/test.tiff"]? Is ImageDimensions[image] = {487, 619} $\endgroup$
    – mrz
    Dec 20, 2016 at 21:58
  • $\begingroup$ I cannot see the image but yes ImageDimensions[image] = {487, 619} $\endgroup$
    – Luigi
    Dec 20, 2016 at 22:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.