Salome HOME
projects
/
modules
/
med.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Windows support
[modules/med.git]
/
src
/
MEDCalc
/
tui
/
medimages.py
diff --git
a/src/MEDCalc/tui/medimages.py
b/src/MEDCalc/tui/medimages.py
index d6f113399fbe8151022f86ba4e6dbe451b985d3a..6493341039f053f0a19374d4ae321e23f981a8c3 100644
(file)
--- a/
src/MEDCalc/tui/medimages.py
+++ b/
src/MEDCalc/tui/medimages.py
@@
-1,5
+1,5
@@
# -*- coding: iso-8859-1 -*-
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-201
5
CEA/DEN, EDF R&D
+# Copyright (C) 2007-201
6
CEA/DEN, EDF R&D
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
@@
-20,7
+20,12
@@
# Author : Guillaume Boulant (EDF)
# Author : Guillaume Boulant (EDF)
-import MEDCoupling as MC
+import sys
+if sys.platform == "win32":
+ import MEDCouplingCompat as MC
+else:
+ import MEDCoupling as MC
+
import MEDLoader as ML
from PIL import Image
import MEDLoader as ML
from PIL import Image
@@
-34,7
+39,7
@@
class FieldBuilder:
# Load the image file in a numpy array using PIL.
img=Image.open(imageFilepath)
imgbw=ImageOps.grayscale(img)
# Load the image file in a numpy array using PIL.
img=Image.open(imageFilepath)
imgbw=ImageOps.grayscale(img)
- # WARN: We keep only the grayscale. Maybe, it could be useful
l
+ # WARN: We keep only the grayscale. Maybe, it could be useful
# to get the RGB scales each on one component of the field.
# Creating a cartesian mesh with a grid of the size of the image
# to get the RGB scales each on one component of the field.
# Creating a cartesian mesh with a grid of the size of the image
@@
-53,7
+58,7
@@
class FieldBuilder:
def createMesh(self, meshname, sizeX, sizeY):
"""
Creating a cartesian mesh with a grid of the size of the image.
def createMesh(self, meshname, sizeX, sizeY):
"""
Creating a cartesian mesh with a grid of the size of the image.
- sizeX and sizeY should be respectively the width and heig
th
of the
+ sizeX and sizeY should be respectively the width and heig
ht
of the
image.
"""
# >>>
image.
"""
# >>>
@@
-83,10
+88,10
@@
class FieldBuilder:
coordsY.setValues(arrY,nbNodesY,1)
cmesh.setCoords(coordsX,coordsY)
coordsY.setValues(arrY,nbNodesY,1)
cmesh.setCoords(coordsX,coordsY)
- print
"Imagem mesh dimension: %d"%cmesh.getSpaceDimension(
)
+ print
("Imagem mesh dimension: %d"%cmesh.getSpaceDimension()
)
# WARN: In the current state of development of MEDLoader, only
# WARN: In the current state of development of MEDLoader, only
- # unstructured meshes are supported for writ
t
ing function in med
+ # unstructured meshes are supported for writing function in med
# files. We just have to convert the cartesian mesh in an unstructured
# mesh before creating the field.
umesh=cmesh.buildUnstructured();
# files. We just have to convert the cartesian mesh in an unstructured
# mesh before creating the field.
umesh=cmesh.buildUnstructured();