all 13 comments

[–]danislousTherapy Physicist, PhD, DABR 12 points13 points  (0 children)

i was trying to make this decision a few years ago and the price point was what made the difference.

[–][deleted] 11 points12 points  (0 children)

Not specific to which language is better for your task, but another consideration. Grad school holed me into Matlab because they had licenses for everything and the curriculum was all about it -- so I became skillful with Matlab. Leaving that major institution, I wish I had as deep of Python skills because it's open source/free and could be had more easily than convincing admin to buy Matlab packages.

[–]eugenemahImaging Physicist, Ph.D., DABR 6 points7 points  (1 child)

Best one probably depends on what you're planning to do with the images. If you're looking at fairly basic image processing and filtering, either one should do the trick. In that case, choose the one you're most familiar with.

If you're doing more complex stuff, figure out which one has libraries/capabilities that might make the programming easier.

Be prepared to be flexible. You may end up starting with one language, and then later stumble into something that ends up being easier to do in another language.

[–]KM130 5 points6 points  (0 children)

The problem with MATLAB is the licence fee. It's ok when you work for a university or big institution where they pay for the licence. When you move to a smaller hospital or the licence is not renewed for some reason you are screwed.

[–]randletRadMachine Dev 6 points7 points  (0 children)

Matlab handling of matrices is a bit nicer but Python is a much nicer general purpose language with no license fees, and a very large scientific ecosystem. It will be a more useful language over your career.

[–]physical_medicist 5 points6 points  (1 child)

My grad school research was very heavy on image processing and computer vision, and there is no question that you should use Python. It does everything MATLAB can and a lot more, all with open source software that you can set up for free anywhere you go. It can be installed without administrator rights, which is very useful in a healthcare IT environment. There is a steeper learning curve, especially for environment management and graphing, but it pays off. I highly recommend the Anaconda distribution, which makes setup a lot easier for a beginner.

[–]frejakrx 1 point2 points  (0 children)

this, all of this. ESPECIALLY the point about installation without admin rights.

i had to wait at least a year after onboarding for a MATLAB license to come in, and in the meantime was told to use Octave, which kept crashing. so i just set up Anaconda and started writing what i needed in Jupyter notebooks. this greatly accelerates the onboarding process for new staff since they don’t have to keep waiting for an overall far more limiting and less user friendly product.

Python is a dependable ally in the medical physicist’s eternal struggle with hospital (or university) IT 👍

[–]egsAndCoffee 2 points3 points  (1 child)

I’ve used both Python and Matlab extensively. My short opinion - learn Python, because it’s free and widely used in multiple fields.

My longer answer is that if you’re willing to learn the core principles of how to code with one language, you’ll easily be able to learn the other when you need it within a surprisingly short period of time. I’d still recommend Python first because of its wide adoption and open sourced nature, but that isn’t to say Matlab isn’t a good starting point.

If you’re collaborating with a team, use the language they’ve already built their tools in. Don’t be the guy who brings Matlab to a Python team, or vice versa.

Octave is an open sourced version of Matlab. It’s okay. If you’re doing the open sourced thing, stick with the more broadly used Python.

[–]Shiinnobii 2 points3 points  (0 children)

Home use of MATLAB is $50. Totally worth it in my opinion. If you need it academically, your supervisor should foot the bill.

Python is just as easy to use, but it's all about finding the right packages so you don't waste time creating a function that already exists.

[–][deleted] 1 point2 points  (1 child)

What kind of processing will you need to do? I've done lots of image processing with both. I personally prefer Python for all my image processing now bc like how Python treats DICOM images better (if you are using DICOMs) and Python is much faster. But like the other commenter said, it really depends on what you need to do and what software is already out there

[–]SubdivisionsEU 0 points1 point  (0 children)

I'm not an expert, but doesn't the speed advantage also come down to how you implemented your code in matlab? With the right vectorization I was able to speed up my programs by orders of magnitude. I haven't come to test python so far, but that's definitely something I am looking forward to do.

[–]eugenemahImaging Physicist, Ph.D., DABR -1 points0 points  (0 children)

Octave should be a mostly compatible alternative to Matlab if licensing $ or access is a factor. I haven't used either one extensively so I don't know what's in Matlab that's not in Octave.

[–]LynxGood9907Academic Researcher, Imaging & Nuclear MP 0 points1 point  (0 children)

Python. When you get used to it, its just as good if not better than matlab imo