Result images when using plantcv parallelization workflow different from ones generated in Jupiter notebook #680
-
As shown in the screenshot, the image on the left is the one I generated in jupyter notebook, the one on the right is the one I generated by converting the notebook to a pipeline and run parallel using plantcv workflow. However when I check the result they are so different.
Actually, I tried to change pcv.params.dpi to 200 in the parallelization workflow, and it appeared to be correct. But I am just very curious, I checked in my notebook, that pcv.params.dpi equals 100. When the result image is saved with dpi=100, there is no issue with it. Added, maybe I did not make myself clear
So the output image was saved (also displayed in the notebook). When using notebook to save the output image, whether using 100 or 200 dpi the saved image would be same (same as the one on the left). However if I used the same code with pcv.params.dpi = 100 in a plantcv workflow to process bunch of images in parallel, I would get result images same as the one on the right. If I set pcv.params.dpi to 200, the result images would be the same as the one in the left. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 4 replies
-
I think this is the same thing that Lucia and Jose were running into. There's a backend matplotlib setting that defaults to a low resolution in Jupyter, but I can't recall how @nfahlgren got around this issue.. |
Beta Was this translation helpful? Give feedback.
-
Wouldn't the low resolution in Jupyter create the opposite symptom than described?
From: Haley Schuhl <[email protected]>
Sent: Thursday, February 4, 2021 09:03
To: danforthcenter/plantcv <[email protected]>
Cc: Subscribed <[email protected]>
Subject: Re: [danforthcenter/plantcv] Result images when using plantcv parallelization workflow different from ones generated in Jupiter notebook (#680)
I think this is the same thing that Lucia and Jose were running into. There's a backend matplotlib setting that defaults to a low resolution in Jupyter, but I can't recall how @nfahlgren<https://urldefense.com/v3/__https:/github.com/nfahlgren__;!!JmPEgBY0HMszNaDT!-jH96EsAuti7bWkvzMwErRpMFO6sTHIKVVm7-PBo9Y0Npc-xyNt-16MXYiOyjG8vym_hFA$> got around this issue..
-
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub<https://urldefense.com/v3/__https:/github.com/danforthcenter/plantcv/discussions/680*discussioncomment-338615__;Iw!!JmPEgBY0HMszNaDT!-jH96EsAuti7bWkvzMwErRpMFO6sTHIKVVm7-PBo9Y0Npc-xyNt-16MXYiOyjG86Mwuw2g$>, or unsubscribe<https://urldefense.com/v3/__https:/github.com/notifications/unsubscribe-auth/ABY5SZMVLZ4QHEPXOLW6P33S5LHI7ANCNFSM4XDCRFOQ__;!!JmPEgBY0HMszNaDT!-jH96EsAuti7bWkvzMwErRpMFO6sTHIKVVm7-PBo9Y0Npc-xyNt-16MXYiOyjG9pgsG0yg$>.
|
Beta Was this translation helpful? Give feedback.
-
When we create the output image with The other thing we sometimes find helps is changing the import matplotlib
matplotlib.rcParams["image.interpolation"] = "nearest" Interpolation options are documented here: https://matplotlib.org/3.3.3/gallery/images_contours_and_fields/interpolation_methods.html |
Beta Was this translation helpful? Give feedback.
When we create the output image with
pcv.visualize.pseudocolor
there is interpolation involved. Small, thin structures can be removed if the output image is smaller than the input image. In Jupyter this typically happens because the notebook displays images at lower resolution for faster loading. But forpseudocolor
this can also happen for saved images because our default output resolution for this kind of images is set to 100 DPI (pcv.params.dpi = 100
). If you increase this value it should help. It's possible it looks okay in Jupyter because you maybe have set the image display size or resolution higher in your notebook already, but not in the script.The other thing we sometimes find h…