0

I have created a tflite model to perform medical image segmentation on an iOS app. nii files will be loaded and converted to numpy array and later perform inference using the tflite model. Normally, this is done on python using the simpleITK library. How can this be done in Swift?

I am new to swift so sorry for the naive question.

1 Answer 1

0

Nifti has a C library to read and write files here:

http://niftilib.sourceforge.net

I haven't developed in Swift, but as I understand it, you can link C libraries in Swift. Here's a page that says how to do that:

https://www.hackingwithswift.com/articles/87/how-to-wrap-a-c-library-in-swift

As far as using numpy goes, that's a Python package. Here's a Stack Overflow question about calling Python from Swift:

Call Python code from an existing project written in Swift

But then, if you can do that, you should be able to call SimpleITK from Swift, removing the need to use Nifti's C library.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.