-
Notifications
You must be signed in to change notification settings - Fork 228
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Compile errors on windows due to changes in nii_dicom_batch.cpp #288
Comments
@fedorov can you provide some input here. The getline call supports a feature you requested but I do not think anyone uses. In order to support many Windows builds, the simple fix is to add a dependency to I prefer to have the minimum number of dependencies for the basic build. @fedorov would you mind if your feature request 252 is included as a compile time option (e.g. By the way, these platform-dependent issues will be caught be AppVeyor when we move this from the developmental branch to the master. Once @fedorov responds, I think we can push a new master stable release. |
No, I would not mind. The motivation for that feature was to support the use of dcm2niix as a Slicer DICOM plugin. Currently, the extension @ljod mentioned does not provide a plugin interface, but it does compile dcm2niix, so this option could be added at compile time. At some point I was planning to contribute the DICOM plugin interface to that extension. |
This all sounds good to me thank you both! |
@ljod and @tashrifbillah - can you test the latest commit on the developmental branch with the Slicer Windows build system. The iostream getline() function looks pretty different from the stdio getline() function I was using. In the latest commit I use fgets() instead of getline(), which works in my Unix environment. It looks like fgets() is also included in (Visual Studio)[https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/fgets-fgetws?view=vs-2019] so I am cautiously optimistic. If my latest commit does not compile with your compiler chain, remove the line:
and it should compile (albeit without the functionality that @fedorov requested). |
Thank you! I think this will be automatically tested tonight by our build system. I'll give you an update here tomorrow. |
@ljod , I think the build went fine as per the errors were concerned. However, taking a closer look at the warnings, I am not sure why However, |
@tashrifbillah the 'uninitialized local variable' reflects that you can not overload C functions. The warning is generated by this line, where the 0 flags that the dti4D structure is not populated. I added a commit that might silence some of these warnings. However, the line numbers in the warnings do not correspond with line numbers shown on Github. Feel free to submit a pull request for the other warnings. Note that g++ and clang++ both compile without these warnings. @ningfei built the dcm2niix superbuild script and knows much more than me about MSVC. He previously noted |
@neurolabusc thanks this is excellent! Please let us know when to switch from the development branch to the main branch. |
See new stable release (v1.0.20190410). Now that NRRD is embedded I would suggest building off the stable master branch rather than the developmental branch. |
Thank you very much! |
* tag 'v1.0.20190410': (52 commits) Update dcm_qa submodule. Prevent MSVC compilation warnings Siemens PASL 3D BIDS tags (http://adni.loni.usc.edu/wp-content/uploads/2010/05/ADNI3_Basic_Siemens_Skyra_E11.pdf) Reduce Microsoft Visual Studio 14 warnings (rordenlab#288) Use fgets not getline (rordenlab#288) Fixes (rordenlab#286; rordenlab#287) Added missing space (coding standard). Supported dicom tag Accession Number (0008,0050). Struct TDICOMdata extended with accessionNumber property, modified dicom loader and supported exporting accession number into json file and using it as filename with %g modifier. Terminate when corrupted DICOM detected (rordenlab#283) Keep more characters for institution address (VR is ST) "dcm2niix -v" returns version (rordenlab#280) NRRD export supports oldmin/oldmax (http://teem.sourceforge.net/nrrd/format.html#oldmin) Assume 1.2.840.10008.1.2 if transfer syntax is empty Option to modify overwrite behavior (rordenlab#276) XA11 classic DICOM uses private tags for DWI (rordenlab#274) Detect Philips when manufacturer (0008,0070) has been erased (rordenlab#267) Detect discrepancies in PAR/REC slice thicknesses (rordenlab#273) New "-x i" option (https://www.nitrc.org/forum/forum.php?thread_id=9324&forum_id=4703) bvecs for Philips DWI using 0019,10bb, 0019,10bc Adjust negative MosaicRefAcqTimes (rordenlab#271) ...
Hi and thank you very much for the recently added nrrd support! We have found that it doesn't yet compile on Windows (in the context of Slicer nightly multi-platform builds that are building dcm2niix) due to some minor issues with abs (needs to be changed to fabs) and getline (could be fixed by updating the code to use istream::getline instead). The needed fixes and the errors are described here:
https://discourse.slicer.org/t/slicerdcm2nii-extension-not-visible-in-extension-manager-despite-successful-build/6435/2
I don't have a Windows machine so I'm posting this here in the hopes that these minor changes are really easy for someone else. Thanks!!!
The text was updated successfully, but these errors were encountered: